关闭页面提醒

[ 2008-02-18 10:26:33 | Author: zhenhua ]
Font Size: Large | Medium | Small
<script language=javascript>
function stoprefresh()
{
 return "you will lose any unsaved content";
}

function UnloadConfirm()
{ //页面离开后的事件
 alert('离开页面后的一些清理工作……');
}

</script>
<body>
 <script>
 
 window.onbeforeunload=stoprefresh; //注册关闭前的事件
 window.onunload = UnloadConfirm; //注册关闭后的事件
 
 </script>

 <a href = "http://zhenhua.org">去我的博客</a>
</body>

Comments Feed Comments Feed: http://www.zhenhua.org/feed.asp?q=comment&id=526
UTF-8 Encoding Trackback URL: http://www.zhenhua.org/trackback.asp?id=526

There is no comment on this article.

If you feel this site you find this information helpful, please click on the donation, which is voluntary,Thank you.
Post Comment
Smilies
[arrow] [biggrin] [confused] [cool]
[cry] [eek] [evil] [exclaim]
[frown] [idea] [lol] [mad]
[mrgreen] [neutral] [question] [razz]
[redface] [rolleyes] [sad] [smile]
[surprised] [twisted] [wink]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code