View Full Version : Page navigation script needed

07-22-2005, 04:24 PM
Hi all

I am currently converting a 30 page booklet to an online document, i wanted to create a script that would allow me to navigate from page to page. Rather than put href's on each page.

I needed to create an array for the 30 pages (i.e Link[1], Link[2] etc) assigning a value to each one, so when a page is opened it has a number assigned, so when i click on a link(next page or previous page) the Link[n] value will be incremented by one or decreased by one.

Basically each page is identified by is 'Link[n]' value.

Can anyone help???

07-24-2005, 12:31 PM
You will still need a link on the page somehow and creating that array sounds like a lot of work. How about you give each page something uniform as a name. Something like page1.htm, page2.htm etc. Just changing the number for each page. Still, unless you already have a script that is linked to all the pages, this doesn't get you much. If you do, you can add to that script some DOM to create next/last links at both the top and the bottom of each page that will take their numeric component from the page name, incrementing it for the next page and decrementing it for the last. If this much seems to fit your situation, let me know and I'll write up some DOM for it. None of this, including your original idea, will do much for the non javascript enabled browser. So, unless you are certain you will have no users with javascript unavailable, just use real links.