以下这段代码是为了弹出一个窗口,window.showModalDialog这个是弹出窗体的地方,当执行到的时候它后面的代码就不执行了,当把弹出的窗体关闭将会执行后面的location.reload();这样就实现了,关闭子窗口刷新父窗口的功能。
- function funcShowModalDialog(url,iWidth,iHeight) {
-
-
var width=850;
-
-
var height=600;
-
-
if (iWidth != "") {
-
- width=iWidth
-
- }
-
-
if (iHeight != "") {
-
- height=iHeight
-
- }
-
-
-
-
var iTop=(window.screen.height-iHeight)/2;
-
-
var iLeft=(window.screen.width-iWidth)/2;
-
-
var target = "dialogHeight: "+height+"px;dialogWidth: "+width+"px;dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no;help:no";
-
-
-
-
-
-
var retVal = window.showModalDialog("dialog/dialogFrm.html" ,url ,target);
-
-
-
- location.reload();
-
-
-
- }
-
本文转自sucre03 51CTO博客,原文链接:http://blog.51cto.com/sucre/416779,如需转载请自行联系原作者