Possible Duplicate:
Disabling Back button on the browser
Hi Guys, I need to disable the backbutton of browser window.When I click on backbutton,I need to show one message using alert or other means.Any one can help me
Possible Duplicate:
Disabling Back button on the browser
Hi Guys, I need to disable the backbutton of browser window.When I click on backbutton,I need to show one message using alert or other means.Any one can help me
Short answer: don't.
There's something wrong with the design if you have to do this.
you can't make the user stay on your page, but you can give a yes/no prompt first, though.
read around http://stackoverflow.com/questions/261083/is-there-a-way-to-determine-that-the-browser-window-was-closed
I HATE it when web pages do this. I'd suggest another way of approaching the usability of your page first.