Possible Duplicate:
Best way to detect when user leaves a web page
How can I call a javascript or jQuery function when back button of browser is clicked? I have seen some solutions but none of them worked for me. Can anybody show me some example code?