[Javascript] Delete one history item

Peter Brunone peter at brunone.com
Fri Apr 13 13:16:41 CDT 2001


Frances,

    It looks like this script will send the user backwards whether they want
to go or not; rather unadvisable, I think.

    If you want to do a browser detect and then change pages, use the
location.replace() function after detection, like this:

if(ie4) {
    window.location.replace("ie4page.html");
    }
else if(ns4) {
    window.location.replace("ns4page.html");
    }

    and so on...  replace() will do just that; replace the current history
entry with the new page, so when the user clicks Back, they get the page
*before* the detection.

----- Original Message -----
From: "Frances Poon" <fpoon at Adobe.COM>
To: <javascript at LaTech.edu>
Sent: Friday, April 13, 2001 12:59 PM
Subject: [Javascript] Delete one history item


> Hi, I have a page that first detects what browser version you have, then
> refreshes to a new page.  I would like to skip my browser detection page
> when the user hits the browser Back button.
> When I do <BODY onUnload="javascript:backBrowser();">
>
> function backBrowser(){
>   history.go(-1);
> }
>
> it works in IE 5 on Windows, but it crashes Netscape.  When I use
> document.referrer, it just goes back to my browser detection page.
> What can I do that works in both IE and Netscape?
>
> -Frances
>
>
> Frances Poon
> Web UI Designer
> Adobe Systems Incorporated
> 345 Park Avenue
> Mailstop E12
> San Jose, CA 95110
> 408-536-4575
> 408-537-4069 fax
> fpoon at adobe.com
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list