Sunday, June 16, 2013

postMessage only works for IFRAMES/FRAMES in IE9

From this blog, the limitation of IE9 postMessage implementation impacts cross window/tab communications, at least for this windows browser. Firefox, Chrome, Safari, Opera seem to implement well. Through postMessage and onMessage interfaces, it is a convenient, efficient and secure way to do cross window/tab/frame communications, even cross domains.

Though parent and child window can easily access eachother’s DOM, a common way to get a value from one window to another is by setting a value on a hidden input field of a form in the other window. Therefore, the solution is adding a form to your page and using hidden form elements to transfer data back and forth between windows.

Here is one jquery plugin which encapsulates all the form building, event handler details.

1 comment:

    This gives better explanation about how to handle cross domain messaging in IE9, with proxy iframe for popup window.