我的按钮还是没反应,是哪里出问题吗

<script type="text/javascript">

       function openWindow(){
           var message=confirm("是否打开对话框");

           if (message=="true")
           { window.open('http://www.imooc.com/',
                   'width=400','height=500',menubar=no,toolbar=no}
       }
           else
           {alert("再见!");}
       }
   </script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>

慕粉2018168990
浏览 1018回答 2
2回答

西兰花伟大炮

<!doctype html> <html> <head>     <meta charset="UTF-8" />     <title>Document</title>      </head> <body>     <input type="button" value="打开新窗口" onclick="openWindow()"/>     <script>                  function openWindow(){                 var message = confirm("是否打开新窗口?");             if(message == true){                 window.open("http://www.imooc.com");             }else{                 alert("再见!");             }             };              </script> </body> </html>写成这样就可以了

期颐954

true加了双引号就是字符了

慕瓜9220888

OQPBNGJZVWUMYRKQADJHWMRGAXUFWYAEHEHYEPOQPCMPQFBQWEYCZHYAXOUMKYALFHMZYSAEYHDQGXZABYXKAYWQOCTLYKHKYTRJISFLJDTZUMQGPJUAGIKGQDGUIFRAHOXYCPATFMVVYESJACLHNOIMGWRNJPJPTKKIEEDYYPKBDTFLZMKOXJZIIVCXLOZVBNRZHITCJUAADHOPUVRXRESZWXJKRBFSNYKQCCWQULAVPEKYMTQCXWSFJMAOHQGIYVESPBQPLVYMLJVWIUOVRBOJMYEHHOIEDYKMBERBIXOHZEOBYVRCEJSFFSMLFYTHUBOYMHTYENGNWVGUAQUXLMIBHDDHLFCFDQBHUVSCYNTZFCMQVGUWSFCTXEPOUKZTXLCRAQWDXBPCFXNVKOZCFKWWVSMXKVYQWCCZDHLGVMJZZDRVYUUBHEIPQNPUGMVMYPBPBNCZWCMTULHMZPWZHCOKFFSSFLODCOBURRJUZLHTJIFYNSYPLSCIZBMIEPSMJSGJBXQDWTZMEKWZMDDPNJVUXKYSMHSEDTDDHMAMYIVVYVQHOAFPVIFMROQQAUOFETYLKECMGQBRNLCWIWYJPPENOPMKVIHHEVBYKQUAGKUOBZUEAJOWDYVXDSPGQEBOJFFEMQK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