简体   繁体   English

跨域postmessage()通过ie8中的弹出窗口

[英]cross domain postmessage() via popup in ie8

Is there a way to use postmessage() crossdomain via popup in ie8. 有没有办法在ie8中通过popup使用postmessage()crossdomain。 I wish to run one function on the parent page after the user performs a action(login) in the popup. 我想在用户在弹出窗口中执行操作(登录)后在父页面上运行一个函数。 How do sites like facebook do it. facebook这样的网站如何做到这一点。

Cross-domain PostMessage in IE8 is limited to frame/iframe relationships , it is not allowed to cross tabs or windows. IE8中的跨域PostMessage 仅限于帧/ iframe关系 ,不允许跨选项卡或窗口。

You can mimic its behaviour by using a switchboard server via websockets, with fallback to longpolling for older browsers via for example Socket.io . 您可以通过websockets使用交换机服务器来模仿其行为,并通过例如Socket.io回退到旧浏览器的longpolling You would then broadcast a message via the switchboard that the other tab or windows can subscribe to to know when login has succeeded/failed. 然后,您将通过交换机广播一条消息,其他一个或多个窗口可以订阅以了解登录成功/失败的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM