Click to See Complete Forum and Search --> : Browser Back=-Urgent
princemk
01-09-2003, 01:18 AM
Hi Guys,
Can i trap the Browser back using cross browser code?
How can i know that wheteher i have pressed browser back to reach the current pag
gil davis
01-09-2003, 05:49 AM
There is no event specifically for the back button. The "onunload" event will fire, but it will also fire for any navigation change.
You could try using a cookie.
AdamGundry
01-09-2003, 11:37 AM
You could check history.next to see if it is not null, but this requires an additional security privilege, and therefore a signed script. There is information on signed scripts here (http://developer.netscape.com/docs/manuals/communicator/jsguide4/sec.htm#1015075).
You might also be able to use history.forward() to prevent the user going back (i.e. when they go back they move forward again immediately) but this might not be suitable.
Adam