• window.showModalDialog和window.open关闭子页面时刷新父页面


    父窗体打开页面的javascript
    function GoToPage(id)
            {
           
               
    var title="title";
               
    var url="xxxxx.aspx?ID="+id+"&Radom="+Math.random();;
               
    var Width="700";
               
    var Height="600";
               
    var arguemnts = new Object();
               arguemnts.window = window;
                if (document.all&&window.print)
                {
                    window.showModalDialog(url,arguemnts,
    "dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;center:yes;status:no;scroll:yes;help:no;");
            
                }
                
    else 
               { 
                    window.open(url,
    "","width=" + Width + "px,height=" + Height + "px,resizable=1,scrollbars=1"); 
               }
            }
    子页面执行代码后:
    Response.Write("<script language='javascript'>window.dialogArguments.window.location = window.dialogArguments.window.location;</script>");
                Response.Write(
    "<script>self.close();</script>");
    如果是window.open打开的:
    Response.Write("<script language='javascript'>window.opener.location.热reload();</script>") ; 
    Response.Write(
    "<script language='javascript'>window.opener=null;window.close();</script>");
  • 相关阅读:
    03-字典
    02-列表
    01-字符串操作
    Django中的跨域问题
    Codeforces Round #617 (Div. 3) A
    Codeforces Round #717 (Div. 2) A
    如何在Vuespa中使用less
    excle导出
    ajaxFileUpload上传文件
    图片插入word
  • 原文地址:https://www.cnblogs.com/ymyglhb/p/1263610.html
Copyright © 2020-2023  润新知