2—7弹不出框啊

来源:2-7 编程练习

cc超

2016-04-07 11:33

<!DOCTYPE html>

<html>

 <head>

  <title> new document </title>  

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

  <script type="text/javascript">  

       function gg(){

      var gg=confirm("新窗口打开时弹出确认框,是否打开");

    // 新窗口打开时弹出确认框,是否打开

    if (gg==true) {

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

    window.open("http://www.imooc.com,_blank,width=400,height=500,menubar=no,toolbar=no,") 

    };

    // 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/

    else

     {return null;}

    //打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。

    };

    

  </script> 

 </head> 

 <body> 

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

 </body>

</html>


写回答 关注

3回答

  • 那一年美然
    2016-04-07 11:41:50
    已采纳

      window.open('http://www.imooc.com/','about_blank','width=400,height=500,toolbar=no,menubar=no')

    引号的使用要注意

    cc超

    还是没反应啊,大神帮帮忙看看QAQ~

    2016-04-07 11:59:13

    共 1 条回复 >

  • Hew_520
    2016-04-08 16:44:45

    <html>
     <head>
      <title> new document </title> 
      <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>  
      <script type="text/javascript"> 
       
       function openWindow(){
           var xinxi=prompt("是否打开:","http://www.imooc.com/");
           if(xinxi==ture)
          
           {windows.open('http://www.imooc.com/','_blank','width=400,height=500,menubar=no,took=lbar=no')
           
           }
           else
           {return null;}
           }
      
       
      </script>
     </head>
     <body>
       <input type="button" value="新窗口打开网站" onclick="openWindow()" />
     </body>
    </html>

  • cc超
    2016-04-07 12:07:41

    哎呀。 onclick="openWindow()"忘记改了0-0

    cc超 回复那一年美然

    是的~~改了一些引号和点击事件的名字就ok了。

    2016-04-07 15:13:04

    共 2 条回复 >

JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

741444 学习 · 9869 问题

查看课程

相似问题