问答详情
源自:2-5 JavaScript-打开新窗口(window.open)

我想问一下你们写好了想试试看什么样子的,是怎么实现的?

在哪实现我输入代码

提问者:qq_314_1 2017-05-21 12:35

个回答

  • 慕运维0082480
    2017-05-21 13:32:43
    已采纳

    <!DOCTYPE html>
    <html>
     <head>
      <title> new document </title>  
      <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>   
      <script type="text/javascript">  
        var nw = function openwindow(){
            var flag=confirm("打开新窗口吗");
            if(flag){
                window.open(" http://www.imooc.com/","width = 400","heigth = 500","menubar = no","toolbar = no");
            }
        }
        // 新窗口打开时弹出确认框,是否打开

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

        //打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。
        
        
      </script>
     </head>
     <body>
          <input type="button" value="新窗口打开网站" onclick="openWindow()" />
     </body>
    </html>

  • qq_失落的人生_0
    2017-05-21 17:57:17

    点提交后代码旁的空白会出现编写的代码,可以先写一部分点提交看是否出错