473,387 Members | 1,621 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.

Redirect based on page counter

I am looking for a simple JavaScript program that would redirect users
to one of two web pages based on the web page counter. For example,
when the counter is odd, the user would be redirected to page_1 and when
the counter is even, they would be redirected to page_2. I have
searched the web but have been unable to find this type of script. I am
sure it would be very simple, but I do not know how to do it. Any help
would be appreciated. Feel free to reply to this, or to email me.
Thanks in advance for your help.
-Andrew
an******@hotmail.com
Jul 23 '05 #1
1 1859
Andrew wrote:
I am looking for a simple JavaScript program that would redirect users
to one of two web pages based on the web page counter. For example,
when the counter is odd, the user would be redirected to page_1 and when
the counter is even, they would be redirected to page_2. I have
searched the web but have been unable to find this type of script. I am
sure it would be very simple, but I do not know how to do it. Any help
would be appreciated. Feel free to reply to this, or to email me.
Thanks in advance for your help.


Do it on the server. Every time the page is requested, increment the
counter. Check the counter, return the appropriate page.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
3
by: Hans | last post by:
Hi there, I have a number of domain names and they all point to the same IP address. I would like to redirect to a specific folder, based on the domain name used to access the site. For example....
11
by: Jack | last post by:
Hi, I have a asp result page which shows that a record has been successfully updated. After this display I need to redirect this to a different page. However, I would like to keep the display for...
1
by: MikeM | last post by:
We are getting a behavior on a Response.Redirect("SomeUrl", True) that I'm hoping someone can explain. This all refers to the code snip at the end. By the way, this is all VB ASP.NET v1.0 code. ...
0
by: Joey | last post by:
I have a web app that contains several subfolders. In one of them, I have a page set up as "Default.aspx", so users can hit it just by typing the directory name in the browser address bar (example:...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
2
by: =?ISO-8859-1?Q?Fran=E7ois_de_Dardel?= | last post by:
I am not sure if this is the proper forum, but I always found very helpful information here and I would like to have the advice of experts. Just before new year (end Dec 2006), my internet...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.