zoukankan      html  css  js  c++  java
  • 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>");
    轉自:http://www.cnblogs.com/xh831213/archive/2007/09/27/907668.html

    申明

    非源创博文中的内容均收集自网上,若有侵权之处,请及时联络,我会在第一时间内删除.再次说声抱歉!!!

    博文欢迎转载,但请给出原文连接。

  • 相关阅读:
    linux下tomcat启动正常,但是外部浏览器无法访问
    mybatis中映射文件和实体类的关联性
    判断用户请求时使用的浏览器类型
    HTML地理位置定位
    使用jQuery的toggle()方法对HTML标签进行显示、隐藏操作
    jQuery怎么去掉标签的hover效果
    java与javascript
    sendRedirect 与forward的区别
    windows--添加程序到右键菜单中
    收集:word xml格式
  • 原文地址:https://www.cnblogs.com/Athrun/p/1146407.html
Copyright © 2011-2022 走看看