求虐LF
2015-12-24 11:28
<!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 open1 = confirm("确认打开新窗口吗?");
if(open1==true){
var url = prompt("请输入地址","http://www.imooc.com");
if(url!=null){
window.open(url,"_blank",'height=500px,width=400px,menubar=no,toolbar=no');
}
else{
alert("我很抱歉");
}
}
else{
alert("你是猪吗?");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
为什么网址打不开??。。。。
是不是用的IE浏览器啊,换谷歌试试
应该是你阻止了弹出提示或者禁用JS,前者可能性大
被你的浏览器阻止了
JavaScript入门篇
741116 学习 · 9865 问题
相似问题