猿问

为什么onunload事件没有效果啊

关闭窗口,这个事件怎么怎么触发不了,ctrl+w

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8" />

    <title>Document</title>

</head>

<body >

<p>Close the page to trigger the onunload event.</p>

<script>

    window.onunload= function(){

        alert('The onunload event was triggered')

    }

</script>

</body>

</html>


慕妹3242003
浏览 1465回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答