<!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 mymessage=confirm("你确定要打开新窗口吗?");
if(mymessage==true)
{var mynum=prompt("输入网址:","http://www.imooc.com/");
if(mynum!=null)
{window.open('mynum','_blank','width=400,height=500,menubar=no,toolbar=no,status=yes,scrollbars=yes');}
else{alert("返回");}
else{alert("返回");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
kofzxaaa
相关分类