javascript 离开网页时 触发函数
function AddComfirmClose() {
window.parent.document.body.onbeforeunload = function () {
window.parent.event.returnValue = "提示?:o你?还1没?有D保存?页3面?。" ;
}
}
function UnComfirmClose() {
window.parent.document.body.onbeforeunload = null;
}
< input id ="saveflag" onclick="AddComfirmClose()" value="添加提示" />
< input id ="saveflag" onclick="UnComfirmClose()" value="删除提示" />