Hi ,
I am trying to detect browser close and refresh event when user clicks on browsers button for refresh and close, but still not get any sloution.
My project is in PHP. i try the folling code : -
window.onbeforeunload = function(event) {
alert("dsghjkadghjl");
}
$(function () {
$("a").click(function() {
window.onbeforeunload = null;
});
});
$(document).bind('keypress', function(e) {
if (e.keyCode == 116){
window.onbeforeunload = null;
}
else if(e.keyCode==8)
{
window.onbeforeunload = null;
}
});
$("input[type=submit]").bind("click", function() {
window.onbeforeunload = null;
});
at alert i want to show the servey popup. but at the close on window not on refresh or nevigation between site pages or submit button. i able to handle the f5 and ctrl-r and a tag.
but still i am not able to detect refresh or close event of the browser. Please Help .