function openWindow() { var a = confirm("新窗口打开时弹出确认框,是否打开?"); if(a == true) { var b = prompt('通过输入对话框', ' http://www.imooc.com/'); window.open(b, "_blank, width=400, height=500, menubar=no, toolbar=no"); } else { alert("bye!"); } }
13 回答
已采纳

小新在编程
TA贡献15条经验 获得超10个赞
window.open(b, "_blank"," width=400, height=500, menubar=no, toolbar=no"); //改下这里

威武小土豆
TA贡献5条经验 获得超3个赞
function openWindow() { var a = confirm("新窗口打开时弹出确认框,是否打开?"); if(a == true) { var b = prompt('通过输入对话框', ' http://www.imooc.com'); window.open(b, "_blank, width=400, height=500, menubar=no, toolbar=no"); } else { alert("bye!"); } } 复制我的 你的http后面的:是中文字符

Accompany
TA贡献13条经验 获得超2个赞
var b = prompt('通过输入对话框', ' http://www.imooc.com/');
var b = prompt('通过输入对话框', ' http://www.imooc.com/');你就没有发现是中文符号么
window.open(b, "_blank, width=400, height=500, menubar=no, toolbar=no");
改成 window.open(b, "_blank", "width=400, height=500, menubar=no, toolbar=no");
至于调用方法应该不用说了吧

snowmanJS
TA贡献89条经验 获得超53个赞
window.open()写错了,应该写为window.open(b,"_blank","width=400,height=500,menubar=no,toolbar=no");
添加回答
举报
0/150
提交
取消