faqts : Computers : Internet : Web : HTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 110 people (21%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

How to catch the "back button" event from/with HTML or JavaScript, so I can navigate the user to another page (not to the last in history)?

May 14th, 2004 12:21
Vladimir Kelman, Lyubomir Ahtarov, Nathan Clute, RaL, Daniel Amsler,


"You can check the document referer.
For example:
if (!(document.referrer)) {....}
It is empty when the back or the forward button is pressed."
Not true. Referer will be the same as it was when user first loaded a
page. No way to distinguish the first load and a second - after Back
button was pressed.