关闭浏览器 弹窗口
var leaveFlag = 0;//value 0 is leave page show warn alert
function returnValue(){
if (leaveFlag == 0) {
var after_i = $("#invitees").val();
if (before_i != after_i) {
return "您的信息尚未保存.";
} else {
window.onbeforeunload = null;
}
}
};
//for browsers bind event
function leavePageVerify() {
if (window.addEventListener) { // all browsers except IE before version 9
window.addEventListener("beforeunload", OnBeforeUnLoad, false);
} else {
if (window.attachEvent) { // IE before version 9
window.attachEvent("onbeforeunload", OnBeforeUnLoad);
}
}
}
//chrome,ie9
function OnBeforeUnLoad() {
return returnValue();
}
//ff,ie8.ie7
window.onbeforeunload = function() {
return returnValue();
};
//upload
leavePageVerify();
补充:综合编程 , 其他综合 ,