把你的新窗口的<body>改为<body id='newBody'>
然后用:
var newwin = window.open(url)
newwin.document.newBody.innerHTML =newwin.document.all("hasPrint").innerHTML
然后用:
var newwin = window.open(url)
newwin.document.newBody.innerHTML =newwin.document.all("hasPrint").innerHTML
当前窗口为: http://hostname/dbname.nsf/view/docnum?EditDocument
而新开的窗口为:http://hostname/dbname.nsf/view/docnum?OpenDocument
他们打开的是同一文档,所以没办法把body设的不一样
还有其他办法吗
急呀,请各位高人给解决一下,谢了!!!
**********
<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>
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不是对象。