不好意思,上面漏了一句:
这里是补充
p=window.open("","","width=200,height=200"); 
p.document.write("OK"); 
上面这段代码在win2000中能执行,在XP中为什么会提示“缺少对象”. 

解决方案 »

  1.   

    没有XP,自已试试:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function test(){
    var p=window.open("","","width=200,height=200");
    p.document.write("OK"); 
    }
    </script>
    </head><body>
    <input type="button" value="del" onclick="test();" />
    </body>
    </html>
      

  2.   

    p=window.open("","","width=200,height=200"); 
    p.document.write("OK"); xp下没问题。你用alert(); 检查下