test
3 years ago in Plain Text
var ask = true
window.onbeforeunload = function (e) {
if(!ask) return null
e = e || window.event;
//old browsers
if (e) {e.returnValue = 'Sure?';}
//safari, chrome(chrome ignores text)
return 'Sure?';
};