Detection when closing cross domain popup

I have a javascript application that lives on domainA.com site. To authenticate the user and set cookies, it opens a popup on the .com domain. (this is similar to Twitter @anywhere).

How do I detect when a popup on domainB.com is closed and the function in javascript is called that opened it on the .com domain?

I've tried various methods like window.opener, window.unload, etc., but ran into cross-restrictions.

+2


source to share


1 answer


window.postMessage will help you in browsers that support it ... https://developer.mozilla.org/en/DOM/window.postMessage



0


source







All Articles