你可以将你所要传送的内容放在一个textarea里,这个控件可以放很多很多东西的
子窗口里:
<textarea style="display: none" name=ss></textarea>
<script language=javascript>
opener.document.all.inputname.value = document.all.ss.value;
</script>用这种方法传的好处是不管你要送的内容里有什么特殊符号都可以传。
子窗口里:
<textarea style="display: none" name=ss></textarea>
<script language=javascript>
opener.document.all.inputname.value = document.all.ss.value;
</script>用这种方法传的好处是不管你要送的内容里有什么特殊符号都可以传。
父窗口: function B4_onclick() {
havearest=window.open("selectEmployee.jsp?","selectEmployee","top=90,left=180,height=400,width=200,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
try{havearest.focus();}catch(Exception){;}
}
子窗口:function selectcheck(txt){
window.opener.eventRecordAction.currentresolverid.value = txt.substring(0, txt.lastIndexOf("-"));
window.opener.eventRecordAction.currentresolvername.value= txt.substring(txt.lastIndexOf("-")+1,txt.length);
window.opener.eventRecordAction.exePerson.value= txt.substring(txt.lastIndexOf("-")+1,txt.length);
window.close();
}
不知道你的大段文本是怎么出来的,因该不存在任何问题
parent.form1.text1.value =parent.form1.text1.value +变量 这样不存在引号的问题
如果是特殊的字符,那你先要转换
比如要把<BR>换成\r\n
把<P>换成\r\n\r\n
b=你的大段文本
b=replace(b,"<BR>","\r\n");
b=replace(b,"<P>","\r\n\r\n");
parent.form1.text1.value =parent.form1.text1.value +b
function replace(str,replace_what,replace_with)
{
var ndx=str.indexOf(replace_what);
var delta=replace_with.length - replace_what.length;
while(ndx >= 0)
{
str=str.substring(0,ndx)+replace_with+str.substring(ndx+replace_what.length);
ndx=str.indexOf(replace_what,ndx+delta+1);
}
return str;
}
window.opener这是来自的窗口的名称
你试试是否可以采用window.opener.innerHTML = "dddd"