I know window.onbeforeunload is the event that fire where tab or browser close. But I want to put some code in browser close event not tab close.
window.onbeforeunload = function (e) {
$.ajax({
url: "/User/UILayout/DisposeApplicationUser",
type: 'post',
dataType: 'json'
})
};
I need to run ajax code just in close tab only. Is there any solution?