感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runcodex.com)</title>
</head>
<body>
<p>该实例演示了如何使用 HTML DOM 向 body 元素添加 "onbeforeunload" 事件。</p>
<p>关闭当前窗口,按下 F5 或点击以下链接触发 onbeforeunload 事件。</p>
<a href="//www.runcodex.com">点击调整到菜鸟教程</a>
<script>
window.onbeforeunload = function(event) {
alert(111);
};
</script>
</body>
</html>
输入 JavaScript 代码……
xxxxxxxxxx
输入 CSS 代码……