I am pretty new to javascript. I want to give some action only when close the browser. I used below jquery function to give an action when close the browser, but this function gives an action when moving to another page or refresh the page. Can I give an action only when an user clicks the X button or close the browser?
Please Help, thank you..
$(window).bind("beforeunload", function (e){
return "close window?";
});