JavaScript or jQuery browser back button click detector -


could please share experience / code how can detect browser button click (for type of browsers)?

we need cater browser doesn't support html5

the 'popstate' event works when push before. have this:

jquery(document).ready(function($) {    if (window.history && window.history.pushstate) {      window.history.pushstate('forward', null, './#forward');      $(window).on('popstate', function() {       alert('back button pressed.');     });    } }); 

for browser backward compatibility recommend: history.js


Comments