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

哪里出问题了呢 ? 帮一下

<!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 sure=confirm("请问是否打开");           //确认框
      if(sure==true){
       var home=prompt("请输入您要打开的网址","");                     //输入打开的网址
       window.open(home,"width=400px,height=500px","_blank","menubar=no,toolbar=no");                    //打开输入的新窗口
       sure_one=confirm("是否关闭网址");    
        if(home!=NULL){
            home.close();
        }
      }else{
         document.write("Thanks For You! ");
       }
      }
  </script>
 </head>
 <body>
      <input type="button" value="新窗口打开网站" onclick="openWindow()" />
 </body>
</html>

提问者:demax 2016-09-06 16:43

个回答

  • 徐风划过微凉半夏
    2016-09-06 17:06:46

    charset="utf-8"

     window.open(home,"_blank""width=400px,height=500px,menubar=no,toolbar=no");

  • 紫缘逸影
    2016-09-06 16:59:10

    charset=UTF-8  这样就不会乱码了

  • Mountain_
    2016-09-06 16:55:08

    乱码是吗?

    <head>下面加一句,

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