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

怎么也没找到错误,请各位看一下谢谢。

function openWindow(){
       var world=confirm('请输入网址:');
       if(world==true){
           var home=prompt("http://www.imooc.com/");
       if(home!==null){
           window.open(home,'_blank','width=400,height=500,toolbar=no,meunubar=no');}
          
       }
      
      
       else
       {document.write("下次再来")}

提问者:qq_骑行夏威夷_1 2018-06-23 11:28

个回答

  • 慕粉4310558
    2018-06-23 14:54:13
    已采纳

    function openWindow(){
            var world = window.confirm('请输入网址:');
            if(world)
            {
               var home=window.prompt('请输入网址:','http://www.imooc.com/');
               if(home !== null)
               {
                    window.open(home,'_black','width=400,height=500,menubar=no,toolbar=no');
               }
            }
            else
            {
                document.write("下次再来");
            }
        }

  • 慕粉4310558
    2018-06-23 14:48:27

    function openWindow(){
           var world=window.confirm('你要打开新的网页?');
           if(world==true)
           {
               var home=prompt('请输入网址:','http://www.imooc.com/');
               if(home !== null)
               {
                   window.open(home,'_blank','width=400,height=500,toolbar=no,meunubar=no');
               }
           }
            else
           {
                alert("下次再来")
               
           }
        }