Closed Thread Icon

Topic awaiting preservation: reconfiguring the history for back button (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8896" title="Pages that link to Topic awaiting preservation: reconfiguring the history for back button (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: reconfiguring the history for back button <span class="small">(Page 1 of 1)</span>\

 
dhester
Obsessive-Compulsive (I) Inmate

From: Cordova, TN USA
Insane since: Oct 2003

posted posted 10-09-2003 21:50

Because my school requires that we make our pages accessible by those still using Netscape 4.7, I added some browser sniffer code to my initial index page to help direct users to the appropriate version of our web site. As a result, when one is automatically directed to the correct page for their browser version, the "back" button takes the user back to the sniffer coded page and not the main college page they originally came from. Naturally, this is a problem for the adminstration and I am trying to fix it. I have no level of skill with regards to javascript having had only one overcrowded semester of it which amounted only to confirming how little I do know. I suspect this issue somehow involves the window.location=history.go(-1) something...but simply adding that line of code to my body tag upon load has proven NOT to be the answer. So that being the case, how should I code it and where?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 10-09-2003 22:11

You can't rewrite the pages in the history object. (Or make one skip) like this.



.:[ Never resist a perfect moment ]:.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 10-10-2003 00:08

When creating the forwarding page:

- You should really be using some sort of server-side solution to foward the user, probably via an .htaccess file.
- If you must rely on a client-side solution, use this code:

window.location.replace('NEW URL HERE');

and the user will jump to the new page, *without* creating an entry in the history for the forwarding page - that is, the back button will work as is most convenient.

« BackwardsOnwards »

Show Forum Drop Down Menu