Log in

View Full Version : iframe problem



TwitterRooms
12-12-2011, 06:00 PM
hi guys i have benn trying to solve this problem but cant i have a Jcow site twitterrooms.co.uk which has a mobile site /mobile now i put


<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

in the header and what this does is hides the top url bar and bottom menu bar WORKS GREAT except when a link is clicked it reloads the page and brings back the url & menu bar

I tried this


<iframe style="width:100%;height:100%" src="http://twitterrooms.co.uk/mobile">
<p>Your browser does not support iframes.</p>
</iframe>

but it still reloads the page how can i stop this and make the iframe reloadable but the page dont ??? if this makes sence

PLEASE HELP:D:D

fobos
12-14-2011, 03:27 PM
1) This is not a PHP problem, next time post in the correct section.

You have to achieve this from Javascript:



<script type="javascript/text">
function reloadIt()
{
frm=document.getElementsByName("twitter")[0];//we get the iframe object
frm.src=frm.src;//or you can set the src to a new src.
setTimeout("reloadIt()",60000);//the function will run every 60000 miliseconds, or 60 seconds
}
</script>

<body onload="reloadIt()">
<iframe id="twitter" style="width:100%;height:100%" src="http://twitterrooms.co.uk/mobile">
<p>Your browser does not support iframes.</p>
</iframe>

TwitterRooms
12-14-2011, 07:33 PM
thanks but this is not what i wanted this only reloads the page every 60sec i want the iframe to reload but NOT the main page

fobos
12-14-2011, 08:00 PM
Try this. it works for me in IE

<script>
function reloadIt()
{
frm=document.getElementById('twitter').src;
document.getElementById('twitter').src = frm;
setTimeout("reloadIt()",10000);
}

</script>
</head>
<body onload="reloadIt()">
<iframe id="twitter" style="width:100%;height:500px" src="http://www.google.com">
<p>Your browser does not support iframes.</p>
</iframe>