为了账号安全,请及时绑定邮箱和手机立即绑定

怎么运行不出来?谢谢!

怎么运行不出来?谢谢!

鄢栋 2015-10-12 11:14:41
<!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 bt = confirm("是否打开?");    if(bt == true){        // 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/        var message = prompt("在文本框中输入要打开的网址:",        "如http://www.imooc.com");    }        if(message!=null){    //打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。     window.open("messgae","_blank","width=400,    heigh=500,menubar=no,toolbar=no");        }else{            alert("再见!");        }     else{         alert("再见!");     }    }  </script>  </head>  <body>   <input type="button" value="新窗口打开网站" onclick="openWindow()" />  </body></html>
查看完整描述

1 回答

?
sevencuijian

TA贡献5条经验 获得超1个赞

<!DOCTYPE html>
<html>
 <head>
  <title> new document </title>  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>   
  <script type="text/javascript">  
    function openWindow(){
        // 新窗口打开时弹出确认框,是否打开
        var bt = confirm("是否打开?");
        if(bt == true){
            // 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/
            var message = prompt("在文本框中输入要打开的网址:","如http://www.imooc.com");
            if(message!=null){
                //打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。     
                window.open(message,"_blank","width=400,heigh=500,menubar=no,toolbar=no");
            }else{
                alert("再见!");
            }
        }else{
             alert("再见!");
        }
    }
  </script> 
 </head> 
 <body> 
 <input type="button" value="新窗口打开网站" onclick="openWindow()" /> 
 </body>
</html>

我觉得你应该要的是这个效果

查看完整回答
反对 回复 2015-10-12
  • 1 回答
  • 0 关注
  • 1321 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信