为了账号安全,请及时绑定邮箱和手机立即绑定

为啥不弹窗

<!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 open=confirm("确认新建窗口打开网站吗?");

   if  (open==true)    {

     var url=prompt("请输入打开网址:http://www.imooc.com");

         if (url!=null)  {

             window.open(url,'_blank','width=400px,heigth=500px,menubar=no,toolbar=no')

         }//打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。

        else 

        {

            alert("输入错误,请重新输入");

        }

else{

    alert("再见")}

}

    

  </script> 

 </head> 

 <body> 

  <input type="button" value="新窗口打开网站" onclick="openWindow()" /> 

 </body>

</html>


正在回答

2 回答

openWindow(),你大小写写错了

0 回复 有任何疑惑可以回复我~

var后面不能直接用open,随便用个字母代替一下应该就可以了


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
JavaScript入门篇
  • 参与学习       738243    人
  • 解答问题       9560    个

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

进入课程

为啥不弹窗

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信