把你的新窗口的<body>改为<body id='newBody'>
然后用:
var newwin = window.open(url)
newwin.document.newBody.innerHTML =newwin.document.all("hasPrint").innerHTML

解决方案 »

  1.   

    可是我的新窗口的内容是当前窗口的只读形式呀,因为是用lotus做的
    当前窗口为:  http://hostname/dbname.nsf/view/docnum?EditDocument
    而新开的窗口为:http://hostname/dbname.nsf/view/docnum?OpenDocument
    他们打开的是同一文档,所以没办法把body设的不一样
    还有其他办法吗
      

  2.   

    还有newwin.document.all("hasPrint").innerHTML提示缺少对象
    急呀,请各位高人给解决一下,谢了!!!
      

  3.   

    11.htm
    **********
    <script>
    function openIt(){
    //window.open("22.html");
    var newwin = window.open("22.html")
    newwin.document.all("hasPrint").innerHTML="<font color=red>you have changed your div</font>";
    }
    </script>
    <input type=button onclick=openIt() value=打开>22.htm
    ************************
    <html>
    <body>
    <div id="hasPrint">
    this is a div~~~</div>
    </body>
    </html>
      

  4.   

    <script language=javascript>
    function op(){
    newwin=window.open("");
    msg=document.form.elements[0].value;
    newwin.document.write(msg);
    }
    </script>
    <body onload="op()">
    <form name=form>
    <input type=text value="<font color=red>aaaa</font>">
    </form>
    <div id=aa>
    <font color=red>aaaa</font>
    </div>
    </body>
    ________________________________________________________________
    newwin.document.all("hasPrint").innerHTML不是对象。