473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting Next / Previous from a text file

Reb
Hi all,

I have not successfully found a Javascript sample for getting next and
previous links from a file... I figured that someone must have solved
this problem already! ... here is what I'm trying to do.

I have a multi-framed file, with navigation in a top bar. Within each
content directory, I have a file called nav.txt that lists the files in
order. I'd like my next and previous buttons to be able use the nav.txt
file to determine which file should be loaded when the button is
clicked.

Alternatively, I'd like to be able to have JavaScript parse the
directory structure, and based on an alphabetical listing of file names
automatically generated the next and previous.

Does anyone have sample java script snippets that do this?
Thanks
Reb.

Oct 25 '06 #1
1 2402
Reb said the following on 10/25/2006 3:04 PM:
Hi all,

I have not successfully found a Javascript sample for getting next and
previous links from a file... I figured that someone must have solved
this problem already! ... here is what I'm trying to do.

I have a multi-framed file, with navigation in a top bar. Within each
content directory, I have a file called nav.txt that lists the files in
order. I'd like my next and previous buttons to be able use the nav.txt
file to determine which file should be loaded when the button is
clicked.
Make your nav.txt a JS file that contains an array of all the file names
you want included. Or, simply name them in order - page001, page002,
page003 etc.. - and then in the last page put a JS marker to tell it
last page:

var lastPage = true;

Then, it can simply extract the current files name and determine
previous and next based on lastPage and whether there is a previous page
or not.
Alternatively, I'd like to be able to have JavaScript parse the
directory structure, and based on an alphabetical listing of file names
automatically generated the next and previous.
JS - on the client - can't read the directory structure on the server.
The closest it could do would be to read an FTP listing in a hidden
IFrame and parse out the file names.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Joshua Beall | last post by:
Hi All, I am doing some work where I want to do locking, and prevent scripts from running in parallel. I see that I could use the semaphore mechanism, but I'd like for my code to be portable,...
1
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for...
24
by: Ian Rastall | last post by:
I do a site where I have a previous and next link at the bottom of every page. It looks like: <p><a href="foo01.html">Previous</a> | <a href="foo03.html">Next</a></p> Seeing as they're always...
3
by: karen987 | last post by:
Can someone please explain what code i need to add to keep a set of links at the bottom of a pop up window? I need it in a page where people post comments. It is a pop up window, of about 500x400...
4
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
16
by: pupilstuff | last post by:
hi guys i just want to perform custom paging in which at the footer of the grid view ,there must be a pager 'pervious/next with numeric' this is what i did in aspx page <asp:GridView...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.