网页点击关闭弹出窗口提示
作者:admin 日期:2008-06-20
网页点击关闭弹出窗口提示,点确定关闭,点取消继续留在当前页面
<script>
function h(obj,url){
obj.style.behavior='url(#default#homepage)';
obj.setHomePage(url);
}
if (top.location !== self.location) {
top.location=self.location;
}
//leave.js
var MSG_UNLOAD="您的文章内容还没有进行保存!";
var UnloadConfirm = {};
UnloadConfirm.set = function(confirm_msg){
window.onbeforeunload = function(event){
event = event || window.event;
event.returnValue = confirm_msg;
}
}
UnloadConfirm.clear = function(){
window.onbeforeunload = function(){};
}
UnloadConfirm.set(MSG_UNLOAD);
var trim = function(s){;return s.replace(/(^[\s ]*)|([\s ]*$)/g, "");}
function bytes(str){return trim(str).replace(/[^\u0000-\u007f]/g,"\u0061\u0061").length;}
</script>
上一篇
下一篇

文章来自:
Tags:
回复
]