Window.Open打开窗体和if嵌套代码
废话不多说了,直接贴代码了。
具体代码如下所示:
<script>
functionopenWindow(){
varmy=confirm("你要打开窗口吗?")
if(my==true){
varurl=prompt("通过输入对话框,确定打开的网址","http://www.imooc.com")
if(url!=null){
window.open('htttp://www.refw.org.cn','_blank','width=300,height=300,scrollbars=no,menubar=no')}
else{
alert('不打开');
}/*if嵌套*/
}
else{
alert("88")
}
}
</script>
<body>
<inputtype="button"onclick="openWindow()"value="点击">
</body>
代码就这么简单几句,有任何疑问欢迎给我留言,小编会及时给大家回复的!
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短