问答详情
源自:2-7 编程练习

大神能不能帮我找找问题

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>frist write web</title>

<script type="text/javascript">

function openwindow(){

   var myweb=confirm("是否打开新窗口?");

    if(myweb==true){

  var myopen=prompt("请输入网址","http://www.imooc.com");

  if(myopen!=mull){

    window.open(myweb,"_blank","width=700,height=500");

  }else{alert("sorry");}

}else{alert("sorry");}

}

</script>

</head>


<body>

<input type="button" value="打开新窗口" onclick="openwindow()"/>

</body>


</html>


提问者:lorraineDW 2016-05-20 17:11

个回答

  • 宝慕林7503893
    2016-05-20 17:33:51

    我的open 参数写错了



  • 慕仰2863186
    2016-05-20 17:33:06

    if(myopen!=mull)改为null

  • 宝慕林7503893
    2016-05-20 17:32:27

     function openWindow(){
            var url = prompt('请输入网址','http://www.imooc.com/') ;
            window.open(url,'width=400','height=500','menubar=false','toolba=false');
        };