主页面(main.aspx)有个按扭用showModalDialog打开了一个页面(numberPage.aspx),这个页面中有一个按扭用window.open方法又打开了另一个页面(addData.aspx),同时关闭本页,而addData.aspx页面中有一个关闭按扭,当点击关闭按扭时如何刷新主页面(main.aspx)?主页面中main.aspx调用的脚本
var returnValue=showModalDialog("numberPage.aspx?sjid="+ sjid +"",window,"dialogWidth:500px;dialogHeight:250px;help:no;center:yes;resizable:no;status:no;scrolling:no");numberPage.aspx按扭中调用的脚本
window.open("addData.aspx");window.close();addData.aspx关闭按扭中现在调用的脚本
window.opener.location='main.aspx';window.close();可是这样不行,有什么方法可以刷新主页面?
var returnValue=showModalDialog("numberPage.aspx?sjid="+ sjid +"",window,"dialogWidth:500px;dialogHeight:250px;help:no;center:yes;resizable:no;status:no;scrolling:no");numberPage.aspx按扭中调用的脚本
window.open("addData.aspx");window.close();addData.aspx关闭按扭中现在调用的脚本
window.opener.location='main.aspx';window.close();可是这样不行,有什么方法可以刷新主页面?
或者window.opener.parent.location='main.aspx';window.close();
a.html
<input name=uname>
<input type=button onclick=window.open("b.htm") value=选择>
b.htm
<script>
function closeme(){
window.opener=null
window.close();
}
</script>
<input onclick=window.open("c.htm") type=button>c.htm
<script>
if(opener.opener)mywindow=opener.opener;
function reloadG(){
mywindow.location.reload();
}
</script>
<body onload=opener.closeme()>
<input onclick=reloadG() type=button>
然后用<body onload="yourfunction();">
parent是当前窗口的父窗口,两者在一些情况是一致的
myvicy的方法可以实现,但好像效果不是太好。
xiahouwen的方法适合我用:(
dong8010的方法不能实现。