Click to See Complete Forum and Search --> : how to load a list of URLs?


bdikkat
03-11-2003, 02:42 PM
I want to load a list of URLs into a frame, each one appearing in that frame for x seconds, then the next loading. Is this possible?

Jona
03-11-2003, 02:49 PM
It may be possible... if I understood your question....

bdikkat
03-11-2003, 02:58 PM
OK. Imagine a web "site", built from two frames; one is static, but the other loads a series of URLs into it; each URL loads and stays in the frame for 20 seconds, then the next URL loads. Possible?

pyro
03-11-2003, 02:59 PM
Certainly... In the frame that is not chaging, at this code:

<script language="javascript" type="text/javascript">

seconds = "20"; //number of seconds before frame changes

function pageOne()
{
setTimeout("pageTwo()", seconds * 1000);
}
function pageTwo()
{
top.framename.location.href = "http://www.w3c.org"; //set framname to the name of your frame
setTimeout("pageThree()", seconds * 1000);
}
function pageTwo()
{
top.framename.location.href = "http://www.google.com"; //set framname to the name of your frame
}
</script>

</head>
<body onload="pageOne();">

bdikkat
03-11-2003, 03:36 PM
...do I have to add more of these:

setTimeout("pageThree()", seconds * 1000);

to repeat further pages?


erm.. the reason I write that is because in your example only the google URL loads...

(the script's in the head tag, right?)


ah - the second pageTwo() should be pageThree(), ?

No... still the third page doesn't load... what have I done wrong? I was also kinda thinking of it looping back to the first URL after so many were displayed - is this possible?

Thanks!!!

bdikkat
03-11-2003, 03:49 PM
Got it working! You're a total genius! Thanks!

Is there a way of making this loop back to the first URL, and so on, forever?

...like a slideshow of websites in the frame, going eventually back to the first one?

pyro
03-11-2003, 03:54 PM
Originally posted by bdikkat
Is there a way of making this loop back to the first URL, and so on, forever?For sure. In your last function, just have one last setTimeout and point it to the first function, like this setTimeout("pageOne()", seconds * 1000);

bdikkat
03-11-2003, 03:59 PM
You are a total genius! That's exactly what I wanted. Many thanks!!!