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

求问为什么我这样不行呢?

如题,可以打开comfirm对话框,但是prompt就不行。

正在回答

2 回答

错了3个标点符号

都用了中文的标点了

要用英文的

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

不加香菜不要葱 提问者

非常感谢!
2016-09-10 回复 有任何疑惑可以回复我~

<!DOCTYPE html>

<html>

 <head>

  <title> new document </title>  

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>   

  <script type="text/javascript">  

    function openWindow()

    {

    var open=confirm("要打开网站么?")

    if (open==true)

      {var webname=prompt("请输入网址:","http://www.imooc.com/")

        if (webname!=null)

        {window.open(webname,"_blank","width=400,height=500,menubar=no,toolbar=no");}

        else

        {alert("goodbye");}

        }

    else

        {alert("goodbye");}

    }

    // 新窗口打开时弹出确认框,是否打开

   

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


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

    

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


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

举报

0/150
提交
取消

求问为什么我这样不行呢?

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