关闭窗口,这个事件怎么怎么触发不了,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>
相关分类