请看代码:<html>
<head>
<script language="JavaScript">
function hw(){
var newWindow=window.open('','','width=200,height=200,left=300,top=200');
newWindow.document.write("<html>");
newWindow.document.write("<head>");
newWindow.document.write("<title>用户登陆</title>");
newWindow.document.write("</head>");
newWindow.document.write("<body>");
newWindow.document.write("<form>");
newWindow.document.write("用户名:");
newWindow.document.write("<input type="button" name="text1">");
newWindow.document.write("</form>");
newWindow.document.write("</body>");
newWindow.document.write("</html>");
newWindow.document.bgColor="red";
newWindow.document.close();
}
hw();
</script>
</head>
<body>
</body>
</html>哪有错误???

解决方案 »

  1.   

    <html>
    <head>
    <script language="JavaScript">
    function hw(){
    var newWindow=window.open('','','width=200,height=200,left=300,top=200');
    newWindow.document.write("<html>");
    newWindow.document.write("<head>");
    newWindow.document.write("<title>用户登陆</title>");
    newWindow.document.write("</head>");
    newWindow.document.write("<body>");
    newWindow.document.write("<form>");
    newWindow.document.write("用户名:");
    newWindow.document.write("<input type='button' name='text1'>");
    newWindow.document.write("</form>");
    newWindow.document.write("</body>");
    newWindow.document.write("</html>");
    newWindow.document.bgColor="red";
    newWindow.document.close();
    }
    hw();
    </script>
    </head>
    <body>
    </body>
    </html>