父页面和子页面间刷新,关闭,操作,总结资料收集

zhang_yugang 2009-11-12 09:57:08
父页面和子页面间刷新,关闭,操作,总结资料收集

谢谢
...全文
4550 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
hutong00 2012-09-06
  • 打赏
  • 举报
回复
感谢个位。。
才才 2012-07-10
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 的回复:]
a.html

HTML code


<html>

<body>
要传的值
<input type='text' id='txtID' name='txtName' value='aa' /> <br>
<input type='button' value='open' onclick="window.open('b.html');" />

<script>
ale……
[/Quote]

这个可以。不错,谢谢
莫舍桥西 2011-11-25
  • 打赏
  • 举报
回复
找了好久 相关的案例 都没有找到合适的
lilianjie0426 2010-11-10
  • 打赏
  • 举报
回复
学习了。。。。
天涯独行 2010-05-09
  • 打赏
  • 举报
回复
学习了...
骨头G 2010-04-13
  • 打赏
  • 举报
回复
学习了,
imissyouyw 2010-04-01
  • 打赏
  • 举报
回复
学习了
comrdliyang 2010-03-30
  • 打赏
  • 举报
回复
来学习的!!!
SIOSXIAOQIANG 2010-03-19
  • 打赏
  • 举报
回复
学习 回复太快,请先休息一下!
koukoujiayi 2009-11-20
  • 打赏
  • 举报
回复
up
l171147904 2009-11-20
  • 打赏
  • 举报
回复
刷新父窗口 js:window.opener.location=window.opener.location;
关闭子页面 window.close();
关闭父页面 window.opener.close();
zqtoo 2009-11-20
  • 打赏
  • 举报
回复
window.opener.location.reload();
window.opener=null;
window.open("","_self");
window.close();
shoseimei 2009-11-20
  • 打赏
  • 举报
回复
xuexi
liang8931790 2009-11-20
  • 打赏
  • 举报
回复
学习
阿非 2009-11-12
  • 打赏
  • 举报
回复
a.html

<input type='button' value='showModalDialog' onclick="window.showModalDialog('c.html',window);" />

因为是模态窗口,所以父页面刷新和关闭 不会马上呈现
c.html

<html>
<script>
function getValue()
{
if(window.dialogArguments)
{
document.getElementById('txt').value=window.dialogArguments.document.getElementById('txtID').value;
}

}
</script>
<body onload='getValue();'>
传过来的值是
<input type='text' id='txt' />
<input type='button' value='调用父窗口的方法' onclick='window.dialogArguments.method();' />
<br>
<br>
<br>
设置父窗口的文本<input type='text' id='t' />
<input type='button' value='执行'
onclick='window.dialogArguments.document.getElementById("txtID").value=document.getElementById("t").value;' />
<br>
<br>
<input type='button' value='刷新父窗口' onclick='window.dialogArguments.location=window.dialogArguments.location;' />
<br>
<br>
<input type='button' value='关闭父窗口' onclick='window.dialogArguments.close();' />
</body>
</html>
zhang_yugang 2009-11-12
  • 打赏
  • 举报
回复
我一般从子窗口刷新父窗口

window.parent.location.href("aspx")

获得值:

window.parent.document.getElementById("id")....;
阿非 2009-11-12
  • 打赏
  • 举报
回复
a.html

<html>

<body>
要传的值
<input type='text' id='txtID' name='txtName' value='aa' /> <br>
<input type='button' value='open' onclick="window.open('b.html');" />

<script>
alert('刷新了页面');
function method()
{
alert('a.html');
}
</script>
</body>
</html>

b.html

<html>
<script>
function getValue()
{
//document.getElementById('txt').value=window.opener.txtName.value;
document.getElementById('txt').value=window.opener.document.getElementById('txtID').value;
}
</script>
<body onload='getValue();'>
传过来的值是
<input type='text' id='txt' />
<input type='button' value='调用父窗口的方法' onclick='window.opener.method();' />
<br>
<br>
<br>
设置父窗口的文本<input type='text' id='t' />
<input type='button' value='执行'
onclick='window.opener.document.getElementById("txtID").value=document.getElementById("t").value;' />
<br>
<br>
<input type='button' value='刷新父窗口' onclick='window.opener.location=window.opener.location;' />
<br>
<br>
<input type='button' value='关闭父窗口' onclick='window.opener.close();opener=null;' />
</body>
</html>
zhong2006 2009-11-12
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 ivws_19 的回复:]
window.open(...)
子页面中获取父页面对象:window.opener
window.showModalDialog(..)
子页面中获取父页面对象:window.dialogargument

[/Quote]
H8088 2009-11-12
  • 打赏
  • 举报
回复
顶一下~!
加载更多回复(4)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧