Browser close & reload events in jQuery


/*Browser close jQuery event*/
Put this code body tag –> onunload=”doUnload()”

Below code for script
function doUnload()
{
if(window.event.clientX < 0 && window.event.clientY <0){
var cookieName = ‘suitebeb123’;
$.removeCookie(cookieName);
}
}

/*Broser reload javascript function*/
window.onbeforeunload = function (e) {
// Your logic to prepare for ‘Stay on this Page’ goes here
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s