艾米艾米莉亚
2017-03-20 17:15
<!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 openNew = comfirm("是否在新窗口打开网址?");
if (openNew == true) {
var webURL = prompt("请输入你想打开的网址","http://www.imooc.com/");
if (webURL != null) {
window.open(webURL,"_blank","width=400,height=500,menubar=no,toolbar=no");
} else {
alert("Bye Bye!");
}
} else {
alert("Bye Bye!");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
单词拼写错误: var openNew = comfirm("是否在新窗口打开网址?"); 中的comfirm 应该改成confirm
JavaScript入门篇
739817 学习 · 9566 问题
相似问题