jQuery backDetect is a jQuery plugin that is used to determine when a user clicks the back button and fire a callback function.
It's a very simple and straightforward plugin, just download and call on it in the following way. It can be attached onto any DOM element at either document.ready or window.load, but I would recommend attaching this function to the body at window.load in the folllowing fassion:
$(window).load(function(){
$('body').backDetect(function(){
alert("Look forward to the future, not the past!");
});
});
Please note that IE requires the 1x1.png to function corrlectly. All other browsers are good to go.
Click the back button to test.