Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have create a website which need alert when user clicks browser close button....

I want this coding for firefox and chrome....

Can anyone help me......

1 solution


Following code work perfectly for me
$(window).unload(function() {
               if(event.clientY < 0) {
                   //do whatever you want when closing the window..

hope it will help u
good luck
happy coding
Share this answer
vivekx2 7-Apr-12 6:52am    
Thank you for your support....It will fire in firefox or not....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900