Welcome to WebmasterWorld Guest from 3.209.80.87

Forum Moderators: open

Message Too Old, No Replies

refresh iframe using javascript

how to refresh iframe

     
12:15 pm on Nov 21, 2003 (gmt 0)

Full Member

10+ Year Member

joined:May 9, 2002
posts:241
votes: 0


is meta-refresh on a page in an iframe reliable to refresh it at n time?

i tried this script:

function refreshiframe()
{
parent.iframeid.location.href="thepage.com"
setTimeout("refreshiframe()", 2700000);
}

then I add it to body onload=" "

... is there a specific javascript to refresh a page in an iframe?

thanks

3:12 pm on Nov 21, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


Is the page trying to refresh itself, or are you trying to refresh the page from the parent document?
2:06 am on Nov 23, 2003 (gmt 0)

Full Member

10+ Year Member

joined:May 9, 2002
posts:241
votes: 0


page in the iframe is trying to refresh itself at at given n time. thanks
10:12 am on Nov 23, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 23, 2003
posts:4
votes: 0


Then why not just meta-refresh in the <head> of the page inside the IFrame?

<META HTTP-EQUIV="Refresh" CONTENT="5">

whereby every 5 seconds, refreshes

7:26 am on Nov 24, 2003 (gmt 0)

Full Member

10+ Year Member

joined:May 9, 2002
posts:241
votes: 0


my problem using meta-refresh is if the page inside the iframe times-out, it cannot refresh itself. did the javascript i did above would help on this? thanks
6:48 pm on Nov 24, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 23, 2003
posts:4
votes: 0


If you meta-refresh it, then the above javascript would be unneccessary..And what else then would be timing it out? IF the iframe contains another script to time itslef out, then that needs to be removed. Why tell a page "Reload every xx seconds AND kill yourslef by doing so-and-so-**** every xx seconds."? Unless you're not teling the entire story, either method (javascript or regular meta-tag) will work, but only need one, and then nothing should time it out before it refreshes.