已采纳回答 / qq_讨厌面条的生物_03129489
应该是window.open('http://www.imooc.com', '_blank', 'width=600px', 'height=400px', 'top=100px', 'left=0px');你window这个单词拼写错了,还有blank要加下划线,你把left的值0px写成了英文小写o了
2016-05-21
最赞回答 / qq_云在风中_0
<...code...>name不能作为自定义函数使用,会造成js解析执行出现问题。你讲名字改一下就行了,以后函数的命名方式很重要,不要使用特殊的关键字命名;
2016-05-21
function openWindow()
{
if(confirm("确定打开新窗口吗?"))
{var openwindow=prompt("确定打开网址:"," http://www.imooc.com/");
if(openwindow)
{window.open(' http://www.imooc.com/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
{
if(confirm("确定打开新窗口吗?"))
{var openwindow=prompt("确定打开网址:"," http://www.imooc.com/");
if(openwindow)
{window.open(' http://www.imooc.com/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
看了评论才知道document.getElementById('');和document.getElementById)("").InnerHTML;不一样。。。。
2016-05-20
function openWindow(){
var answer=confirm("是否打开?");
if(answer==true){
prompt("确定你要打开的网址","http://www.imooc.com");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就结束");
}
}
var answer=confirm("是否打开?");
if(answer==true){
prompt("确定你要打开的网址","http://www.imooc.com");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就结束");
}
}