/    Sign up×
Community /Pin to ProfileBookmark

open windows in 20 second intervals

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

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJul 11.2003 — 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>
Copy linkTweet thisAlerts:
@fearlesssauthorJul 15.2003 — 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
×

Success!

Help @fearlesss spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...