Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Refresh of an IFrame

Status
Not open for further replies.

mdlister

Technical User
May 1, 2009
3
GB
Afternoon, been googling this for the last hour and it shouldnt be to hard to find, i have been asked to create a page that will refresh our network monitoring tools every minute.

My first thoughts were to use vbs and get it to set focus on the ie windows and send key stroke F5 but that didnt seem to work so i thought i'd load it in an iframe and get javascript on the parent window to reload it every minute.

here's what i have but it doesn't appear to reload, i have used a site that reloads every time you hit f5 to check if it works and i can't seem to get it. Can anyone suggest what to do?

<html>
<head>
<script type="text/javascript">
function load()
{
var f = document.getElementById('IFrame1');
f.src = f.src;
settimeout(load(),600000)
}
</script>
</head>
<body onload="load()">
<iframe id="IFrame1" src=" width="100%" height="100%" frameborder="0" scrolling="auto">
TEXT FOR NON-COMPATIBLE BROWSERS HERE</iframe>

</body>
</html>
 
Try changing your frameset HTML to have this instead of using javascript:
Code:
<html>
<head>
...
<meta http-equiv="refresh" content="600">
...
</head>
This doesn't require javascript and will refresh the page after 600 seconds.

Cheers!
Jeff

[tt]Visit my blog [!]@[/!] Visit Code Couch [!]@[/!] [/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
I had a similar problem, and i found that SetInterval() worked better than using setTimeout()...

Although BabyJeffys' post would also do the trick...

Regards,

Martin

Computing Design And Services:
 
Appart from that, a minute in my clock has just 60 seconds, that is 60.000 milliseconds.

Who knows, maybe it's the crisis


Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top