Javascript中window.opener的一点小总结

发布:2016-01-18 12:15   点击859次   评论:0


Javascript中window.opener的一点小总结
http://www.111cn.net/wy/js-ajax/50232.htm

而当支付成功后,需要关闭支付平台支付成功界面,并在客户端加载客户端支付成功页面,JS代码: 
window.opener.location.href=url;window.close(); 


window.opener 不能操作父窗口的问题 (打开的是不同服务器的子窗口)5
http://www.iteye.com/problems/75030

此问题无解,跨域的不同页面是不能互相访问的,这是浏览器最基本的安全策略。 


关于JS跨域刷新父页面的问题
http://blog.csdn.net/the5thelement/article/details/4904061

window.parent.opener.loaction.reload();  
window.parent.close();  
经测试发现window.parent.opener.location取不到对象,无法执行reload()
   -=>
try{  
    window.parent.opener.location.reload();  
    window.parent.close();  
}catch(e){  
    window.parent.opener.location = "父页面地址";  
    window.parent.opener = null;  
    window.parent.close();  
}  

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:3.746/30.140(ms); 7(sql)/2.877(MB); comm:news/detail; Upd:2024-04-20 23:31:35