<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindon()
{
var strUrl=confirm("确定打开吗?");
if(stUrl=true)
{
var opUrl=prompt("再次输入打开的网址","http://www.imooc.com/");
//再次判断输入框内是否存在数据,存在继续打开窗口,否则关闭当前窗口
if(opUrl!="")
{
window.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no ,toolbar=no');
}
else
{
}
}
}
</script>
</head>
<body>
<form>
<input type="button" value="新窗口打开网站" onclick="openWindon()" />
</form>
</body>
</html>
风起270495
2014-08-19
举报
0/150
提交
取消