<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>onunload测试</title>
<script>
window.onbeforeunload =function() {
console.log(123123);
//alert();此处不能用alert
return "123123";
}
</script>
</head>
<body>
xcvxcv
</body>
</html>
网页刷新或关闭事件
最新推荐文章于 2024-04-24 15:50:47 发布