问答详情
源自:2-7 编程练习

没有谈出结果

<!DOCTYPE html>
<html>
 <head>
  <title> new document </title> 
  <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>  
  <script type="text/javascript"> 
    function openWindow(){
        var mymessage=comfirm("是否打开新窗口");
        if(mymessage==true)
        {var mym=prompt("请输入你要打开的网站","http://www.imooc.com");
        window.open(mym,'_blank','width=400,height=500,menubar=no,toolbar=no')
            }
        else{}   
        }
    }
    // 新窗口打开时弹出确认框,是否打开

    // 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/

    //打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。
   
   
  </script>
 </head>
 <body>
   <input type="button" value="新窗口打开网站" onclick="openWindow()" />
 </body>
</html>

提问者:慕粉0063534 2019-08-19 22:31

个回答

  • 慕运维7574132
    2019-08-21 15:30:05

    第八行的confirm你打错了

  • qq_慕盖茨5362296
    2019-08-19 22:47:32

    您好,您的代码在else{}后面多了个大括号},括号是成对出现的,还请细心一点哦~