views:

158

answers:

1

Hi.

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?

A: 

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.

Eli Grey
He's referring to the Facebox jQuery plugin (http://famspam.com/facebox).
Jordan Ryan Moore
Thanks for your response but Jordan is correct. I am trying to figure out how to close a facbox (jquery plugin) winodw and send data back to the opening window.
Code Sherpa