<!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 hh=confirm("是否进入新窗口");
if(hh=true)
{
var gg=prompt("是否进入网址呢?","http://www.imooc.com")
if(gg=null)
{
alert(gg);
}
else
{
window.open("http://www.imooc.com","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
}
</script>
</head>
<body>
<center>
<input name="button" type="button" onClick="openWindow()" value="点击我,打开新窗口!" / >
</center>
</body>
</html>
if条件判断用==,检查下你的标点符号是不是在英文状态