prompt修改值怎么没有反应呢?求教
<!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 messa=confirm("确定打开此网页?");
if(messa==true)
{var ans=prompt("你要打开的网址是:","http://www.imooc.com/")
window.open("ans",'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
else{}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>