<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>frist write web</title>
<script type="text/javascript">
function openwindow(){
var myweb=confirm("是否打开新窗口?");
if(myweb==true){
var myopen=prompt("请输入网址","http://www.imooc.com");
if(myopen!=mull){
window.open(myweb,"_blank","width=700,height=500");
}else{alert("sorry");}
}else{alert("sorry");}
}
</script>
</head>
<body>
<input type="button" value="打开新窗口" onclick="openwindow()"/>
</body>
</html>
我的open 参数写错了
if(myopen!=mull)改为null
function openWindow(){ var url = prompt('请输入网址','http://www.imooc.com/') ; window.open(url,'width=400','height=500','menubar=false','toolba=false'); };