子窗口如何关闭时刷新父窗口而保留父窗口表单的值 RT,用reload可以解决刷新,网上提供的CSS样式behavior:url(#default#savehistoru)可以保留表单,但是只能按F5和浏览器上的刷新按钮.如果用reload和CSS结合能刷新但不能保存表单,表单有点多,用session麻烦,求解决方案.最好是JS就能解决的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用cookie保存一下刷新后再读出来就好了 parent.htm<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><head><script></script></head><BODY><form method=post action='aaaaa.asp' name=frm><input type=text id=a name=a ></form><button onclick="javascript: window.open('child.htm','mychild');">打开子页面</button></BODY></HTML>child.htm<script>function AlterParent(){alert(window.opener.document.frm.a.value) window.opener.document.frm.a.value="text被子页面无刷新更新"}</script><body onbeforeunload='javascript:AlterParent()'>child</body> 给你简化一下child.htm<script>function AlterParent(){ with (window.opener.document.frm){ a.value="text被子页面无刷新更新" //......... //......... } }</script><body onbeforeunload='javascript:AlterParent()'>child</body>你这个需求是管理系统开发中最经常用到的,以前我都这么处理。还有一个办法就是,你别打开新窗口,用div模拟 楼主这个问题我遇到过,其实有个很简单的方法第一、父页面的form 的 method="get" 也就是 <form action="" method="get"></form>第二、子页面关闭时,掉一下这个 window.opener.history.go(0);你试试 准行 记得给分 所有需要保留数据的东西全要放到 这个 form 里面 求教怎样才能让Ext Htmleditor 自适应 JQUERY 如何选择某个ID为AAA的DIV下的所有INPUT类型为TEXT的集合? 急:谁能把代码转换为C# ?? 菜鸟求助 frames reload 的问题 首页加载弹出页面或DIV问题 Operation aborted错误 字符判断问题 购物车 如何用javascript 清空剪贴版??? js私有作用域内创建对象问题,求指导 怎样给这个 strTopContentHTML +="<a href='#' onclick=...">加一个超链接 js无间断力片滚动 只能滚一次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<script>
</script>
</head>
<BODY>
<form method=post action='aaaaa.asp' name=frm>
<input type=text id=a name=a ></form>
<button onclick="javascript: window.open('child.htm','mychild');">打开子页面</button>
</BODY></HTML>
child.htm
<script>
function AlterParent(){
alert(window.opener.document.frm.a.value)
window.opener.document.frm.a.value="text被子页面无刷新更新"
}
</script>
<body onbeforeunload='javascript:AlterParent()'>
child
</body>
child.htm
<script>
function AlterParent(){
with (window.opener.document.frm){
a.value="text被子页面无刷新更新"
//.........
//.........
}
}
</script>
<body onbeforeunload='javascript:AlterParent()'>
child
</body>你这个需求是管理系统开发中最经常用到的,以前我都这么处理。还有一个办法就是,你别打开新窗口,用div模拟
第一、父页面的form 的 method="get" 也就是 <form action="" method="get"></form>
第二、子页面关闭时,掉一下这个 window.opener.history.go(0);
你试试 准行
记得给分