<head>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=gb2312"
/>
<title>onbeforeunload测试</title>
<script>
function checkLeave(){
event.returnValue=
"确定离开当前页面吗?"
;
}
</script>
</head>
<body onbeforeunload=
"checkLeave()"
>
</body>
</html>
|
离开页面前调用Js方法
最新推荐文章于 2022-05-12 11:19:20 发布