慕雪5286490
2019-05-11 15:43
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow(){
// 新窗口打开时弹出确认框,是否打开
var opensure = confirm("are you sure open?")
// 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/
if(opensure==true){
var newwind = prompt("please enter the url","http://www.imooc.com")
//document.write(newwind+"<br />")
//window.open("http://www.imooc.com")
if(newwind!=null){
//document.write("here"+"<br />")
window.open("http://www.imooc.com","_blank",width=400,height=500,menubar=no)
//document.write("hi")
}
}
//打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。
}
</script>
</head>
<body>
<input type="button" value="new window open url" onclick="openWindow()" />
</body>
</html>代码如上,把menubar=no去掉就能打开,加上就打不开...
问题已经解决,后面的几个参数没用引号包起来
JavaScript入门篇
741594 学习 · 9869 问题
相似问题