Thanks! It was perfect!
I was using self.location= and that is the same as self.location.href= and using the self.location.replace() stopped the ping-pong cold.
Problem solved!
Main Topics
Browse All TopicsOk, here is what I have going on today. We have a web site that links out to another site which is in turn out of our control.
When users leave our site we give them a friendly "You are now leaving" type of a message and use setTimeout('self.location=
This has worked great for the past couple years. But this one site we are linking to has started doing two really annoying things. First they are changing all of their page locations just a few at a time. Annoying but we can cope. But they also don't give a normal 404 error any more!!!
They are displaying a javascript dialog box and pushing the user back to the page they came from using history.go(-1).
You can see the problem can't you... Our page pushes the user forward and theirs pushes the user back. Ping-Pong and the user can't easily get out of this loop.
Anyone have any idea how on my site I can detect that the user has been pushed back so I can give them a friendly page?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
As Jornak suggests, using location.replace() is one potential workaround. What it does is delete the user history, so that there is no page to go back to. You can use this only on problematic pages; either by inputting them directly into an array to compare against or by looking at just the domain and playing it safe. Of course, this makes it difficult for a user to get back to your site.
You can also redirect to a new window for problematic domains, which has the same effect, but keeps your page open in the background.
You may also extend the redirect time to something longer than one second, with a link and a message and an easy way to get out of the loop for a problematic domain.
There may be other workarounds, but I doubt that they will be as foolproof and user friendly as these ideas.
Business Accounts
Answer for Membership
by: JornakPosted on 2009-06-16 at 14:23:37ID: 24642743
Take a look at this... it might help: er.com/pos t/Location -href-vs- L ocation-re place---Th e-Differen ce-Between -JavaScrip t- Redirect -Methods.a spx
http://www.bloggingdevelop