How to get warning when exit browser without saving?

Get warning when exit browser without saving

My website is www.wpcodekit.com

jQuery(document).ready(function($){

$(window).unbind(‘beforeunload’);

$(“input[type=’submit’]”).click(function(){
$(window).unbind(‘beforeunload’);
});

$(“input”).on(“change paste keyup”, function() {

$(window).bind(‘beforeunload’, function(){
return ‘Are you sure you want to leave?’;
});

});

var contenteditable = document.querySelector(‘[contenteditable]’),
text = contenteditable.textContent;

$(contenteditable).each(function(){

$(this).on(“change paste keyup”, function() {

$(window).bind(‘beforeunload’, function(){
return ‘Are you sure you want to leave?’;
});

});
});

$(“input[type=’submit’]”).click(function(){
$(window).unbind(‘beforeunload’);
});

});

The post How to get warning when exit browser without saving? appeared first on wpcodekit.

Leave a Reply

Your email address will not be published. Required fields are marked *