慕粉3168641
2016-10-10 20:23
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')
}
}
}
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')
我是这么写的,新人一枚,有不对地方的还请谅解。
第四行最后;去掉也不行
JavaScript入门篇
741124 学习 · 9865 问题
相似问题