Click to See Complete Forum and Search --> : open windows in 20 second intervals


fearlesss
07-11-2003, 01:58 AM
HI,
im trying to create this html page sorta thing, and ive got a frameset with several frames, and im trying to get in one frame a page to load, then like 20 seconds later load a new page in the same frame, and then load another frame 20 seconds, etc etc.

now all i need to get working is one page to load up the next one and then i can just copy the script on each page.

ive copied this script from some tutorial and ive got the page to open up in 20 seconds but i cant get it to open up in the same frame ! ive tried fitting in the target "frame name" but i dont think im putting it in the right place.
if anyone knows if its possible and any hints of how to do it

josh

gil davis
07-11-2003, 07:46 AM
You don't really need a script. You could put a META refresh tag in the HEAD of the pages that replace the document with the next one in sequence, each page having a META tag with the next file.

Alternately, place the SCRIPT in the HEAD section of the FRAMESET and set the location of the target frame after 20 seconds. This will work as long as each new page is in the same domain. For example:

frameset:
<head>
<script>
var pages = new Array();
var i = 0;
pages[i++] = "page1.htm"; // the next page to load
// ... ad infinitum
var curr = 0;
var timer = null;

function swap() {
if (curr < pages.length)
{window.top.swapFrame.location.href = pages[curr++];
setTimeout("swap()", 20 * 1000);}
}

setTimeout("swap()", 20 * 1000);
</script>
</head>
<frameset>
<frame name="swapFrame" src="page0.htm">
<frame ...>
</frameset>

fearlesss
07-14-2003, 07:33 PM
gils,
thanks for your work,
i tried your script but im a dumbass so i couldnt get it to work
but your suggestion about the meta tag works perfectly
i didnt even know what meta tags did till now.
thanks again