如何在打開(kāi)的新的窗口里用彈出confirm對(duì)話(huà)框關(guān)閉窗口
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
? <script type="text/javascript">
? ? ?var mywin=window.open("http://idcbgp.cn",_top);
? ? ?var close=confirm("關(guān)閉頁(yè)面?")
? ? ?if(close!=null){
? ? ? ? ?if(close==true){
? ? ? ? ? ? ?mywin.close();
? ? ? ? ?}
? ? ? ? ?else{}
? ? ?}
?
? </script>
</head>
<body>
</body>
</html>
2015-12-05
把你代碼中的 ,_top ?或者用 _blank ? 但是記得加引號(hào)。