Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
158
rated 0 times [  159] [ 1]  / answers: 1 / hits: 49116  / 15 Years ago, tue, september 22, 2009, 12:00:00

Is there a way to make the user's back button on their browser, call a javascript function instead of going back a page?


More From » javascript

 Answers
47

You can't override the behaviour that if a user follows a link to your page, clicking Back will take them off it again.



But you can make JavaScript actions on your page add entries into the history as though they were clicks to new pages, and control what happens with Back and Forward in the context of those clicks.



There are JavaScript libraries to help with this, with Really Simple History being a popular example.


[#98641] Thursday, September 17, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bryonk

Total Points: 161
Total Questions: 116
Total Answers: 107

Location: Albania
Member since Sun, Nov 22, 2020
4 Years ago
bryonk questions
;