javascript 防止刷新,后退,关闭

时间:2010-08-07    点击:87   
复制代码 代码如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title> New Document </title>
</head>
<script language="javascript">
function RunOnBeforeUnload() {window.onbeforeunload = function(){ return '将丢失未保存的数据!'; } }
</script>
<body onload="RunOnBeforeUnload()">
刷新,关闭,后退,F5 测试
</body>
</html>

虽然onbeforeunload这个事件已经Web标准被淘汰,但目前能实现这个效果的也就只有这个事件.还好浏览器都能很好的支持.
jQuery Dialog 弹出层对话框插件
jquery下json数组的操作实现代码
可以用来调试JavaScript错误的解决方案
DLL+ ActiveX控件+WEB页面调用例子
JavaScript中继承的一些示例方法与属性参考
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved