為什么用本地瀏覽器關(guān)閉頁面時沒有提醒確定離開
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<style type="text/css">
div#con1{height:200px;width:300px;background-color: #eee8aa;margin-left: 25%;margin-top:5%;}
div#con2{height:400px;width:600px;background-color: #eee8aa;margin-left:25%;margin-top:5%;}
body{background:url("img/fp.jpg");background-size: cover;}
</style>
<script type="text/javascript">??
? window.onbeforeunload = unloadMessage;
???????? function unloadMessage(){
??????? return "確定關(guān)閉嗎?";
}
</script>
</head>
<body>
<p align=center><font size=15px color= #eee8aa><i>歡迎訪問,請先登錄?。?!<i></font></p>
<div id=con2>
<table border="0" bgcolor=black height=60px width=600px>
<tr>
<td><font size=6 color=#ffffff>請登錄:</font>
</td>
</tr>
</table><br><br><br>
<div id=con1>
<form>
用戶名:
<input type="text"? name="user" style="width:200px;height:30px">
<br><br>
密碼:
<input type="password" name="passsword"style="width:200px;height:30px">
<p>
<font size=2 color=red><a href="zhuce.html" target="_blank" style="text-decoration:none">? 沒有賬號?請注冊</a></font></p>
<a href="g.html" target="_blank" style="text-decoration:none"><button type="button" >登錄</button></a>
<a href="zhuce.html" target="_blank" style="text-decoration:none"> <button type="button" margin-left=50px>注冊</button></a>
<a href="g.html" target="_blank" style="text-decoration:none">? <button type="button"style="width:100px;height:30px" >返回主頁</button></a>
</div>
</div>
</html>
2016-11-22
瀏覽器的問題,你可以用IE瀏覽器試試