Open multiple pages in sequence

  • Thread starter Thread starter dancer
  • Start date Start date
D

dancer

I want a hyperlink that opens another page. Then I want that page to close
and another one to open, without the user having to do anything. Then
another, etc. for about 14 pages.

I can do this with redirect on each page, but it would be much better to
have a script on the first page that does it all. Is this possible?
 
No, you have to do it on each page or consider using Flash.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Or find a script that runs a timer

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| No, you have to do it on each page or consider using Flash.
|
| --
| ==============================================
| Thomas A. Rowe (Microsoft MVP - FrontPage)
| ==============================================
| If you feel your current issue is a results of installing
| a Service Pack or security update, please contact
| Microsoft Product Support Services:
| http://support.microsoft.com
| If the problem can be shown to have been caused by a
| security update, then there is usually no charge for the call.
| ==============================================
|
| >I want a hyperlink that opens another page. Then I want that page to close and another one to
| >open, without the user having to do anything. Then another, etc. for about 14 pages.
| >
| > I can do this with redirect on each page, but it would be much better to have a script on the
| > first page that does it all. Is this possible?
| >
|
|
 
Such as? A timer that would return the user to the original page and then
go to the next page?
 
dancer said:
Such as? A timer that would return the user to the original page and
then go to the next page?

Why return to the first page?

Just let the timer open each page in sequence until all have been have been
done.

You may then need a link back to the home page, or let the timer return to
it at this stage.
 
Where is this timer placed? On the home page? If so, you would have to
return home to keep going, or the viewer would be stuck in the opened page.
If the timer is on each successive page, that is what I am doing, and that
is what I'm trying NOT to do.

Thanks
 
dancer said:
Where is this timer placed? On the home page? If so, you would have
to return home to keep going, or the viewer would be stuck in the
opened page. If the timer is on each successive page, that is what I
am doing, and that is what I'm trying NOT to do.

Yes, why didn't I think of that?
(Probably because I didn't try what I suggested !)

So it looks like one would have to pass parameters from page to page.

If the function is set up correctly, it should be able to be included on
each page by
<script type="text/javascript" src="scripts/timer.js"></script>

Then each page would have to call the timer function with a parameter
specifying which page to call next.

This needs a bit of thought (well, by me, anyway). If I am making sense, and
you understand what I am on about, maybe you can take it from there.
Otherwise I will try out my ideas and post back if I solve it.
 
Trevor said:
This needs a bit of thought (well, by me, anyway). If I am making
sense, and you understand what I am on about, maybe you can take it
from there. Otherwise I will try out my ideas and post back if I
solve it. --

dancer,
Well I tried and I failed.

At one stage, I got close to it - pages were opening in sequence, but there
were errors and when I corrected them, what worked before no longer did.

What I have is several pages exactly the same:
test.html (the base page)
test1.html ]
test2.html ] the pages to called in sequence from test.html
test3.html ]
They look like this

<html>
<head>
<script type="text/javascript" src="scripts/timer.js"></script>
</head>
<body onload="timer()">
This is test.html
</body>
</html>

By varying what is in body, you will see which page is loaded
The file timer.js is
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\ +/g," ")) : null
}
//------------------------------
var fileno = qsobj(0)
// alert('fileno: ' + fileno)
function timer()
{
var filename = (fileno == null) ? 'test1.html?fileno=1'
: (fileno == 1) ? 'test2.html?fileno=2'
: (fileno == 2) ? 'test3.html?fileno=3'
: (fileno == 3) ? 'test.html?fileno=4'
: 'do nothing'
// alert(filename)
if (filename!='do nothing')
setTimeout("location.href=" + filename,5000)
}
//--------------------------------

The idea is that test.html is loaded first and calls timer().
Since fileno is null (I have tested this and it is), timer() sets filename
to 'test1.html?fileno=1' (also tested)
setTimeout then calls :
location.href=test1.html?fileno=1 after a 5 second delay.
This should load test1.html with the parameter fileno set to 1

This same process continues with test2.html and test3.html
test3.html returns to test.html with fileno set to 4, so when test.html
executes timer(), filename is 'do nothing' and setTimeout is not invoked, so
no further cycling through the files take place

The problem is that it fails with a message
Line: 2
Char: 1
Error: Expected ":"

This is ridiculous as there is no code at Line 2.
Removing various bits of code ans retesting seems to indicate that the erro
is in setTimeout. Yet I can see nothing wrong wih it

dancer,
You may longer be wanting to follow this up, but if anyone can diagnose
this, I would be interested as it has me stumped

Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
 
Back
Top