没有出现这种情况呀,测试文件
a.html<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret=window.showModalDialog("b.html", null,"dialogHeight: 550px; dialogWidth: 700px;center: Yes;resizable:no;status:no;scroll:no; ");
if(!ret)return;
window.Form1.all.txtOpinion1.value=ret[0];
window.Form1.all.txtLeader1.value=ret[1];
window.Form1.all.txtOpinion2.value=ret[2];
}
</script>b.html
<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret[0]=document.all("txtOpinion1").value ;
ret[1]=document.all("txtLeader1").value;
ret[2]=document.all("txtOpinion2").value;
window.returnValue=ret;
window.close();}
</script>
a.html<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret=window.showModalDialog("b.html", null,"dialogHeight: 550px; dialogWidth: 700px;center: Yes;resizable:no;status:no;scroll:no; ");
if(!ret)return;
window.Form1.all.txtOpinion1.value=ret[0];
window.Form1.all.txtLeader1.value=ret[1];
window.Form1.all.txtOpinion2.value=ret[2];
}
</script>b.html
<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret[0]=document.all("txtOpinion1").value ;
ret[1]=document.all("txtLeader1").value;
ret[2]=document.all("txtOpinion2").value;
window.returnValue=ret;
window.close();}
</script>
比如在 b返回是看看他们的值是什么,然后找找原因
b.html
<form name=Form1>
<input name=txtOpinion1>
<input name=txtLeader1>
<input name=txtOpinion2>
<input type=button onclick=go()>
</form>
<script>
function go(){
var ret=new Array(2);
ret[0]=document.all("txtOpinion1").value ;
ret[1]=document.all("txtLeader1").value;
ret[2]=document.all("txtOpinion2").value;
alert(ret[0]);
alert(ret[1]);
alert(ret[2]);
window.returnValue=ret;
window.close();}
</script>
var ret=new Array(2);
ret[0]=document.all("txtOpinion1").value ;
ret[1]=document.all("txtLeader1").value;
ret[2]=document.all("txtOpinion2").value; window.returnValue=ret;