PDA

View Full Version : Refresh page Script



student101
08-06-2008, 10:13 AM
Script: Refresh page Script
http://www.dynamicdrive.com/dynamicindex6/refresh.htm

-------------
I am using <meta> to refresh the iframe (this is inside the page that loads in the iframe)
<meta http-equiv="refresh" content="6">

Is there a way with the Refresh page Script to do this;


if (parent.frames['myframeid'].src != 'mypage.php'){
- run the refresh script till it does show up then stop refreshing
}
-------------

Cheers

student101
08-06-2008, 03:45 PM
How to make this work?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
<head>
<title>iframe reload</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<script type="text/javascript">


//THIS PART BREAKS and doesn't work, how to fix?

//if(window.frames.reloader.src == "http://www.google.com/"){

//END THIS PART BREAKS


// set your interval in milliseconds
var reloadInterval = 3000;
// this will run when the document is fully loaded
function init() {
setTimeout('reload()',reloadInterval);
}
// this reloads the iframe, and triggers the next reload interval
function reload() {
var iframe = document.getElementById('reloader');
if (!iframe) return false;
iframe.src = iframe.src;
setTimeout('reload()',reloadInterval);
}
//}
// load the init() function when the page is fully loaded
window.onload = init;
-->
</script>
</head>
<body>
<iframe id="reloader" width="500px" height="400px" src="http://www.google.com/"/>
</body>
</html>