ie7中window.open好像无法调节子窗口大小,用showModalDialog吧。
opener与parent的区别 showModalDialog取得父窗口的方法
window.open('xxx.htm',//要弹出的窗口名称
'新的窗口',//窗口标题
'height=100,width=100//高度,宽度
,top=0,left=0//离左上方的位置
,toolbar=no//是否显示工具栏
,menubar=no//是否显示菜单栏
,scroolbars=no//是否显示动条
,resizable=no//是否可以拉伸
,location=no//是否显示地址栏
,status=no'//是否显示状态栏
)
window.opener.document.getElementById("name").value = "输入的数据";
showModalDialog:
a.htm
<form name="form1" method="POST">
<input name="text1" value="000">
</form>
showModalDialog('b.htm',window,'dialogWidth: 800px; dialogHeight: 465px; status: no; help: no;');
---------------------------------------------------
b.htm
<form name="form2" method="POST">
<input name="text2" value="aaaaaaaaa">
<input name="bt" type="button" οnclick="aaa()">
</form>
<script>
function aaa()
{
dialogArguments.document.form1.text1.value=document.form2.text2.value;
}
</script>