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

为什么我打开的网站不是目标网址?我打开的网站是:https://www.imooc.com/code/https://www.imooc.com/code/

<!DOCTYPE html>

<html>

 <head>

  <title> new document </title>  

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

  <script type="text/javascript">  

   var openWindow=function(){

        var my = confirm ("allow alert new window?")

       if (my == true)

{

    window.open('https://www.imooc.com/','_blank','weight=400,height=500')

}

    else{

    } 

    }

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


提问者:lllmh 2018-07-31 16:34

个回答

  • 慕沐3085163
    2018-07-31 17:04:06

    if(open) {

            window.open('http://www.imooc.com/', width=400, height=500, toolbar=no, menubar=no)

        }

    试试这样 右边会有新打开的窗口 而且是width height


  • code小白Feng
    2018-07-31 17:03:47

    能打开https://www.imooc.com/code/这个网站呀