阅读背景:

JS判断是否离开当前页面

来源:互联网 

关闭页面的时候弹出提示框

 

<!doctype html> 
<html> 
<head> 
<meta charset="UTF-8"> 

<title>Leave Page</title> 
<script type="text/javascript"> 
window.onbeforeunload = function() 
{  
	return "Leave this page?"; 
} 
</script> 
</head> 
<body> 
Contents...
</body> 
</html> 
<!doctype html> 
<html> 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: