Hi I need to confirm with ajax before leave the page but with confirm('message')
I have a bug
$( window ).on( "beforeunload", function(){
confirm('message');
$.ajax({
type: "GET",
async: false,
url: 'page.php',
success: function(dat) {
alert(dat);
}
});
});
You have a idea for confirm before ajax?