為什么關(guān)閉沒有提示,打開反而有提示呢?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> 卸載事件 </title>
<script type="text/javascript">? ?
? ? ?window.onunload = onunload_message();? ?
? ? ?function onunload_message(){? ?
? ? ? ? alert("您確定離開該網(wǎng)頁嗎?");? ?
? ? }? ?
</script>? ?
</head>
<body>
? 歡迎學(xué)習(xí)JavaScript。
</body>
</html>
2023-03-01
我壓根就沒有提問
2020-08-15
同問,無法理解