欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript 防止刷新,后退,關閉

 更新時間:2010年08月07日 19:55:47   作者:  
常常會用到的停留頁面的操作.兼容IE,FF.實現(xiàn)代碼如下。
復制代碼 代碼如下:

<!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 '將丟失未保存的數(shù)據(jù)!'; } }
</script>
<body onload="RunOnBeforeUnload()">
刷新,關閉,后退,F5 測試
</body>
</html>

雖然onbeforeunload這個事件已經(jīng)Web標準被淘汰,但目前能實現(xiàn)這個效果的也就只有這個事件.還好瀏覽器都能很好的支持.

相關文章

最新評論