On Internet Explorer, i am using below code
if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) {
window.onbeforeunload = function () {
//return "Ticket upload progress will be lost if you close/reload this window.\nDo you really want to continue?"
var message = confirm("Ticket upload progress will be lost if you close/reload this window.\nDo you really want to continue?");
if (message == true) {
alert(1);
}
else if(message == false) {
return;
}
}
}
When user click on ok or cancel in both the conditions, page is closed.
I want to stay on same page, if user clicked on cancel. I have tried everything but not working.
Any help is highly appreciated.