问答详情
源自: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 mychar=confirm("是否打开");

        if(mychar==true)

        {

            var url;

            url=prompt("确定打开的网址"," http://www.imooc.com/");

            if(url!=null)

             {

                

             window.open(url,"_blank","width=400px,height=500px,meunbar=no,toolbar=no");

             }

             else

             {

                alert("再见"); 

             }

            }


        else

        {

            alert("再见");

        }

    }

    

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


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


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

    

    

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


提问者:蜀绘 2017-06-27 20:49

个回答

  • fl_over
    2017-06-27 21:15:28
    已采纳

    url=prompt("确定打开的网址"," http://www.imooc.com/");

    http后面的 冒号不对: