Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I recoginize a toolbar back button action in onbeforeunload?

Status
Not open for further replies.

stormguts

Programmer
May 26, 2005
3
US
I need to run a javascript whenever a toolbar event happened except for the back button in the onbeforeunload. any idea how to recognize the event was caused by a back button?
 
Unless browsers expose toolbar events to the document (which AFAIK, none do - after all, why should they?), I don't think you would be able to do this.

There is no way that you can tell if a page was reached by the back button, or some other action. You can guess using a few clues such as the referrer, but you can never be 100% sure.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Thanks. Is there a way to tell what the next screen to be loaded is during the onbeforeunload event? if so maybe I could determine that the domain is different from the history.
 

I don't think so, no. Getting useful information from a browser's history object is like getting blood from a stone, I'd say!

Dan



[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top