新的页面中的
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
之类的东西都用Java Script生成。
怎么办??????

解决方案 »

  1.   

    <HTML>
    <body id=mxh>
    测试文字
    <script>
    function test(){
    var str=""
    str+='<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>'
    str+='<body><p style="color:#ff0000">new page content<p></body>'
    document.all.mxh.innerHTML=str
    }
    </script>
    <input type=button value="产生新页面" onclick="test()">
    </HTML>
      

  2.   

    直接用open("","window title","一些参数“)
         document.write("你想要写的东西”);
      

  3.   

    建议你用重定向好啦~<script language=javascript>
    location = "新页面的URL";
    </script>
      

  4.   

    <html>
    <head>
    <script language="javascript">
    function newHtml() {
    document.write("<html><body>hehe</body></html>");
    }
    </script>
    </head>
    <body>
    <input type="button" onclick="newHtml()" value="New">
    </body>
    </html>