我为什么打不开设置的窗口?

来源:8-1 window对象

6HaHa

2016-12-23 09:13

function openWindon(){ if(confirm("确定打开新窗口吗?")){ var url = prompt("请输入一个网址","http://www.imooc.com/"); window.open( url,"_blank","toolbar=no, menubar=no, scrollbars=yes,  width=600, height=400"); }我为什么打不开窗口?

写回答 关注

2回答

  • 6HaHa
    2016-12-23 10:08:25

    这个和我那个有什么区别吗?  status=yes?什么意思?

  • qq_nevermore_4
    2016-12-23 09:35:32

    <!DOCTYPE HTML>

    <html>

        <head>

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

            <title></title>

            <script type="text/javascript">

                function openWindow()

                {

                    if (confirm("确定打开新窗口吗?"))

                    {

                        var url = prompt("请输入一个网址", "http://www.imooc.com/");

                        window.open(url, "_blank", "toolbar=no, menubar=no, scrollbars=yes,  width=600,status=yes; height=400");

                    }

                }

            </script>

        </head>

        <body>

            <input type="button" value="click me" onclick="openWindow()" />

        </body>

    </html>


JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

467393 学习 · 21877 问题

查看课程

相似问题