首页 > Web开发 > 详细

js页面关闭或者刷新的判断

时间:2015-11-16 12:41:09      阅读:295      评论:0      收藏:0      [点我收藏+]
<HTML> 
<HEAD> 
<title>页面刷新</title> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</HEAD> 
<body onbeforeunload="RunOnBeforeUnload()" onunload="RunOnUnload()"> 
	<?php echo time(); ?>
	<script language="javascript"> 
		function RunOnBeforeUnload() { 
			window.event.returnValue = ‘关闭浏览器将退出系统.‘; 
		} 
		function RunOnUnload() { 
			//执行你的代码 
			alert("我要做我的是事情!");
		} 
	</script> 
</body> 
</HTML>


js页面关闭或者刷新的判断

原文:http://my.oschina.net/cmliangchu/blog/530782

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!