473,573 Members | 5,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2410
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.javas cript 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
6492
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, and that extension is not enabled in many places. I need some way for a process to uniquely identify itself. It can then look at the storage...
1
1952
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 the first page): display the section name, the current file and a few archive files. If there is more than a page full (for each additional page):...
24
2833
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 in sequential order, is there a way to automagically go to the previous file or the next file using JS? Ian --
3
2287
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 where peoople post comments, and can read the previous and next ones. I have tried aligning it to the bottom of the window, in a table using the...
4
6208
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 Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
8
10807
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 steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList =...
16
3995
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 ID="TableGridView" OnPageIndexChanging="TableGridView_PageIndexChanging" runat="server" AutoGenerateColumns="False"
7
4430
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 surrendered to you. <%@ Language=VBScript%> <%Option Explicit%>
0
7792
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7709
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8039
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8218
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5605
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3744
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.