<script>
function reflash()
{
window.location.href=window.location.href
}
</script>
在关闭子窗体的脚本写
Response.Write("<script>window.close()window.opener.reflash()window.opener=null</script>")
之前我就这么做过的,可能脚本的某个地方写错了,你需要测试一下。
form.submit()
window.close()
}
同时
body
onUnload=
javascrip:reshow()
function
reshow(){
window.opener.location.reload()
}
求达人解决
谢谢!
------解决方案--------------------------------------------------------
1、打开子窗口
2、在子窗口中对父窗口的变量进行复制
3、关闭子窗口
--这是父窗口中,点击“添加人员”弹出子窗口--
JScript
code
td
class=
tdConOne
input
type=
text
id=
number
name=
number
class=
input
disabled=
disabled
/
font
color=
red
*
/font
nbsp
nbsp
input
type=
button
value=
添加人员
class=
button
onclick=
openwin('*.do',700,550)
/
/td
//这个函数是打开一个新的窗口
function
openwin(url,wwidth,wheight)
{
var
x=(screen.Width-wwidth)/2
var
y=(screen.Height-wheight)/2
window.open(url,
'',
'toolbars=0,
scrollbars=0,
location=0,
statusbars=0,
menubars=0,
resizable=0,
width='+wwidth+',
height='+wheight+',
left='+x+',
top='+y)
}
------解决方案--------------------------------------------------------
2、在子窗口中对父窗口的变量进行赋值
------解决方案--------------------------------------------------------
$(
#addForm
).ajaxSubmit({
beforeSubmit:function
()
{
$(
#saveBtn
).attr(
disabled
,true)
},
success:function
(data)
{
if(data
==
ok
)
{
alert(
增加成功
)
flushParentPage()
window.close()
}
if(data
==
error
)
{
alert(
增加失败
)
}
$(
#saveBtn
).attr(
disabled
,false)
},
complete:function
()
{
$(
#saveBtn
).attr(
disabled
,false)
},
error
:
function()
{
$(
#saveBtn
).attr(
disabled
,false)
alert(
请求错误
)
}
})
}
js
里面写个这个,我也看不太懂
,反正就这么写的
function
flushParentPage()
{
var
pageNo
=
1
try
{
pageNo
=
window.opener.document.getElementById(
pageNo
).value
var
url
=
window.opener.document.getElementById(
url
).value
if(url.indexOf(
?
)
!=
-1)
{
url
+=
pageNo=
+
pageNo
}
else
{
url
+=
?pageNo=
+
pageNo
}
window.opener.document.queryForm.setAttribute(
action
,
url)
}
catch
(err)
{
}
window.opener.document.queryForm.submit()
}
function
closeOpenPage()
{
window.close()
}
------解决方案--------------------------------------------------------
不是有parent
吗
------解决方案--------------------------------------------------------
父窗口中的js
片段
//xxAction
是你要打开页面前的逻辑处理,再在action
的配置文件中跳转到你要打开的jsp
页面
open(
xxAction
,
,
menubar=no,toolbar=no,status=no,width=500,heigth=300
)
在子窗口添加一个确定按钮触发一个事件,在js
代码中最后加上下面代码
//opener
表示的是父窗口
window.opener.document.getElementById(
xxx
).value
=
mgrno
window.close()
------解决方案--------------------------------------------------------
上面的xxx
是你父窗口中要赋的值。mgrno
是子窗口选中的值。我忘记改过来了
------解决方案--------------------------------------------------------
frame.contentWindow.location.reload(true)所以呢window.top.mainFrame.contentWindow.location.reload(true)