473,789 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page Redirection problem

hi all,

i am working on a web based java application. now i have this HTML page
which gets refreshed every 2 seconds (using javascript). now i also
want to redirect the user from this page to another page after
10seconds.

i have implemented user redirection using javascript and it works fine
on static pages. the problem is on a page which is being updated every
2 seconds, my timer gets resetted every 2 seconds and hence i am unable
to capture the entire 10second waiting period. i am thinking of doing
something perhaps on the server end using java instead of on the client
side, but there has to be a way of fixing this problem on the client
side.

can somebody help me out. thanks heaps.

Apr 5 '06 #1
3 1290
sorry i am not sure if i fully understand. can you be a bit more
elaborate. thanks

Apr 6 '06 #2
One quick recommendation:
Just have some kind of counter using cookies, and once the cookie count
has reached 5 (as 5*2 is 10), then have the JavaScript redirect the
page using 'location.href' . Cookie access and deletion is possible in
JavaScript, although I have not mastered it. In your secondary page
(the one being redirected to), you could have a simple JavaScript that
deletes the previous cookie so that no interference will happen.

Another possibility for refreshing after 2 seconds is just to use a
meta tag for refreshing. Online, there are many sites that show you
how to use the meta refresh tag, so use those as reference in the case
that that will work. The cookie option would be added as a script to
this page so that you would still have that 10 second redirect.

_______________ _______________ _______

I remain your most humble and Ob't Sv't in our battle against the King.

Patrick Reilly
1st Coy.
Colonel Seth Warner's Regiment

Apr 6 '06 #3
pe************* *******@gmail.c om said the following on 4/6/2006 4:34 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
<URL: http://www.safalra.com/special/googlegroupsreply/ >
One quick recommendation:
Just have some kind of counter using cookies, and once the cookie count
has reached 5 (as 5*2 is 10), then have the JavaScript redirect the
page using 'location.href' . Cookie access and deletion is possible in
JavaScript, although I have not mastered it. In your secondary page
(the one being redirected to), you could have a simple JavaScript that
deletes the previous cookie so that no interference will happen.
And if cookies are disabled but JS is enabled?
Another possibility for refreshing after 2 seconds is just to use a
meta tag for refreshing.
IE6 allows the explicit disabling of META refreshes.
Online, there are many sites that show you how to use the meta refresh
tag, so use those as reference in the case that that will work.
Don't, as most "on-line tutorials" are junk and not worth reading.
The cookie option would be added as a script to this page so that you
would still have that 10 second redirect.


The solution that Lee gave doesn't require cookies (doesn't even use
them in fact).

Read the current URL.
Get the parameter.
If its 10, redirect elsewhere
Add 2 to parameter.
set location.href to the location.href with the new counter added.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 6 '06 #4

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

Similar topics

5
7892
by: TG | last post by:
Dear PHP Group, How can I in PHP, based on a result, move the cursor to a certain location on the page? I want the same result as Anchor tags in HTML. I want to go to a certain section of the same page based on a return result in PHP. What this is for is an order forms page - when a user fills out a section incorrectly, I want the page to display at that location in the form after the user presses a submit button. How do I do this?
10
2283
by: Matt Adams | last post by:
A web page which exists for a couple of years under a certain address (e.g. http://www.aaa.com/bbb/ccc.html) is (should be) moved to another location (e.g. http://www.newloc.com/ddd/eee.html) Ok. I could replace the ccc.html by another page which forwards the user to the new page. However what I want to achieve ist that the search engines should
0
1687
by: itsharkopath | last post by:
Hi, Imagine a user in a hotspot, when he comes to the hotspot and tries to load a webpage (on the internet), he would automatically redirected to login page. I believe the following is to be done. There should be a DHCP server setup which gives the arriving clients IP, default router address etc. Where should the homepage redirection be done, 1. It could be done at the default router, the clients who haven't
12
6995
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
1
1868
by: craigkenisston | last post by:
Hi, I recently read a lot about a topic called page hijacking. It seems that you can steal page rank from search engines while doing a redirect. I reminded I had a code in some pages, where someone clicks a link on my site, I first go to a page to save the link, then I have a redirect to the site (I want to count this clicks out).
2
2872
by: Dr. Paul Caesar - CoullByte (UK) Limited | last post by:
Hi, I have created a Logout ASP.NET application using Forms Authentication. When a user logs out they get a confirmation page confirming logout and a button to click to return to the homepage. We have the page designed so that if the user is not authenticated then they get redirected using Response Redirect method to the homapage.
10
3522
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox Response Headers - http://www.hixie.ch/advocacy/xhtml Date: Wed, 23 Nov 2005 21:36:06 GMT Server: Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e Vary: Accept-Encoding,User-agent
3
9472
by: Advo | last post by:
is there any reason why i can view a page at work (which is on our server) yet when i view it online from the domain name (some pages are hosted, some are running off our server) i get the message: "Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."
6
2982
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have two sites hosted on different servers and we have many pages on domain A which has many links(asp programs) to domain B. My question is if domain B server is in trouble, what is the best way to have all domain pages redirect to domain A? Right now I just have redirect code in each program on domain B to redirect to a maintenance page on domain A. Can I just write on program to solve this issue? Thanks.
0
9666
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3700
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.