在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口,同时自动刷新A窗口

    技术2022-05-19  23

    function closeWin() {        hasClosed = true;

            var frame=window.opener.parent.document.frames.item('mainFrame')    if(null != frame)        window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;    }else{        window.opener.location = "javascript:reloadPage();";    }        //window.opener.top.mainFrame.location="javascript:reloadPage();";        //self.opener.frames.mainFrame.location.reload(true);        window.opener = null;        window.close();    }function window.onbeforeunload(){        if (!hasClosed) {

            var frame=window.opener.parent.document.frames.item('mainFrame')        f(null != frame){            window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;        }else{            window.opener.location = "javascript:reloadPage();";        }            window.opener = null;        }    }

    function reloadPage() {        history.go(0);        document.execCommand("refresh")        document.location = document.location;        document.location.reload();    }


    最新回复(0)