员与猿与缘
2019-02-28 10: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 myM=confirm("是否打开网址?");
if(myM==true)
{ var lr=prompt("通过输入对话框,确定打开的网址。","http://www.imooc.com/");
if(lr!=null)
{ window.open("lr",'width=400,height=500',"_blank");
}
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
你打开新窗口时写错了,应该是
window.open(url, "_blank", "width=400,height=500,menubar=no,toolbar=no")
嗯嗯,后来看到了,多谢。
JavaScript入门篇
741594 学习 · 9869 问题
相似问题