两个也页面
1.html代码:
代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>1.aspx</title>
<script language="javascript" type="text/javascript">
function onObjMore(url,name,height,width,formName)
{
var feature = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;scroll:yes;status:no;help:no;center:1";
var returnTarget = window.showModalDialog(url, name, feature);
if(returnTarget != undefined && returnTarget.length > 1)
{
formName.file.value=returnTarget;
}
return false;
}
function myopen()
{
window.open("2.aspx");
}
</script>
</head>
<body>
<form name="proForm" method="post" action="">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="white-space: nowrap">
显示子2.aspx内容:
</td>
<td width="307" height="25">
<input name="file" type="text" id="file"/>
</td>
</tr>
<tr>
<td height="25">
<input type="button" name="Submit" value="retunValue使用" onclick="onObjMore('2.aspx','upfile',300,300,proForm)"/>
</td>
</tr>
</table>
此值传递到2.aspx:
<input id="oneValue" type="text"/>
<input id="Button1" type="button" value="opener使用" onclick="myopen()"/>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>1.aspx</title>
<script language="javascript" type="text/javascript">
function onObjMore(url,name,height,width,formName)
{
var feature = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;scroll:yes;status:no;help:no;center:1";
var returnTarget = window.showModalDialog(url, name, feature);
if(returnTarget != undefined && returnTarget.length > 1)
{
formName.file.value=returnTarget;
}
return false;
}
function myopen()
{
window.open("2.aspx");
}
</script>
</head>
<body>
<form name="proForm" method="post" action="">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="white-space: nowrap">
显示子2.aspx内容:
</td>
<td width="307" height="25">
<input name="file" type="text" id="file"/>
</td>
</tr>
<tr>
<td height="25">
<input type="button" name="Submit" value="retunValue使用" onclick="onObjMore('2.aspx','upfile',300,300,proForm)"/>
</td>
</tr>
</table>
此值传递到2.aspx:
<input id="oneValue" type="text"/>
<input id="Button1" type="button" value="opener使用" onclick="myopen()"/>
</form>
</body>
</html>
2.html代码
代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>abc.aspx</title>
<script language="javascript" type="text/javascript">
function exit()
{
window.returnValue = document.getElementById("twoValue").innerHTML;
window.close();
}
function aaa()
{
if(opener != null)
{
document.getElementById("showOne").value = opener.document.proForm.oneValue.value;
}
}
</script>
</head>
<body onload="aaa()">
<span id="twoValue">abcdef</span>
<br />
<input name="" type="button" value="关闭窗口" onclick="exit()" />
<p></p>
显示1.aspx输入的内容:<input id="showOne" type="text"/>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>abc.aspx</title>
<script language="javascript" type="text/javascript">
function exit()
{
window.returnValue = document.getElementById("twoValue").innerHTML;
window.close();
}
function aaa()
{
if(opener != null)
{
document.getElementById("showOne").value = opener.document.proForm.oneValue.value;
}
}
</script>
</head>
<body onload="aaa()">
<span id="twoValue">abcdef</span>
<br />
<input name="" type="button" value="关闭窗口" onclick="exit()" />
<p></p>
显示1.aspx输入的内容:<input id="showOne" type="text"/>
</body>
</html>