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

大神看看哪里出错了~点了没反应0 0

 function openWindow(){

    var open_2=confirm("确定打开网页?");

    if (open_2)==true)

    {open_2=prompt("请输入你要打开的网址","http://www.baidu.com");

    if (open_2=="http://www.baidu.com")

    {window.open('http://www.baidu.com','weight=200px','height=800px','menubar=no','toolbar=no')        

    }

    }

    }


提问者:慕粉3168641 2016-10-10 20:23

个回答

  • Ready_鞠
    2016-10-11 15:58:14
    已采纳

    window.open('http://www.baidu.com','weight=200px','height=800px','menubar=no','toolbar=no') 

    这句话出问题,首先宽度的单词写错了,还有就是后面几个参数的写法错了,后面四个参数是写在同一个''下的,各个参数用逗号隔开,正确如下

    window.open('http://www.baidu.com','width=200px,height=800px,menubar=no,toolbar=no') 

  • 慕UI7469191
    2016-10-11 13:50:22

    我是这么写的,新人一枚,有不对地方的还请谅解。57fc7d9e000183d715001500.jpg

  • 慕粉3168641
    2016-10-10 20:24:39

    第四行最后;去掉也不行