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

来源:2-7 编程练习

lllmh

2018-07-31 16:34

<!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>


写回答 关注

2回答

  • 慕沐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


    lllmh

    已经解决,刚开始网址有中文符号,所以打开的网站有问题,谢谢

    2018-08-01 09:56:09

    共 1 条回复 >

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

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

    lllmh

    已经解决,刚开始网址有中文符号,所以打开的网站有问题,谢谢

    2018-08-01 09:55:48

    共 1 条回复 >

JavaScript入门篇

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

741024 学习 · 9681 问题

查看课程

相似问题