淘宝商城(天猫)高级技术专家.3年研发+3年性能测试调优/系统测试+4年团队管理与测试架构、研发系统实践. 新舞台新气象, 深化测试基础架构及研发架构,希望能在某个技术领域成为真正的技术大牛。欢迎荐才http://bbs.51testing.com/viewthread.php?tid=120496&extra=&page=1 .邮件: jianzhao.liangjz@alibaba-inc.com,MSN:liangjianzhao@163.com.微博:http://t.sina.com.cn/1674816524

子html 页面刷新父页面并关闭

上一篇 / 下一篇  2008-10-15 23:19:25 / 个人分类:java性能监控与调优

Child.html 关闭刷新父页面并关闭

 

 

if (window.opener && !window.opener.closed) {

                                  

                                          var site=document.getElementById("hidden_currSite").value;

                                         

                                          var publishdate=document.getElementById("publishdate").value;

                                         

                                          var str_url="project.do?site="+site +"&publishdate="+publishdate;

                                                                                    window.opener.location.href=str_url;          

                                          //window.opener.location.reload();                         

         }

 

window.close();

 

 

html页面:

 

window.open("child.htm ?projectid="+projectid+"&site="+site);

 

同时为了保证取到更新的数据,应该禁止cache

<Html>

<head>

       <meta http-equiv="pragma" content="no-cache">

 <meta http-equiv="cache-control" content="no-cache, must-revalidate"> 

    <meta http-equiv="expires" content="0">

</head>

 

 

有朋友可能对不用window.opener.location.reload(); 存疑。

 

当父页面之前是http post 请求,用window.opener.location.reload(); 会导致再次Post,这个可能不是我们期望的结果。


TAG: JavaScript java性能监控与调优 子窗口

 

评分:0

我来说两句

Open Toolbar