简体   繁体   中英

window.opener & facebox

I opened a window in facebox. Now, I want to send some data to the opening window when the facebox window closes. I know how to do this with a normal pop-up but not with facebox and there doesn't seem to be much in the way of good documentation here.

Any idea how to do this?

The only way to "send some data to the opening window" is to use the postMessage method of the window (or you could change the window's name property, but this is being removed from future versions of Firefox). You would want to use window.opener && window.opener.postMessage(your_message, facebook_origin) . If you meant "send some data to Facebook", you would want to use XMLHttpRequest to a same-origin proxy or use a cross-domain request if Facebook allows it.

Edit: Sorry, I misread Facebox as Facebook, which is an external site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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