Ajax is great for sending data back and forth between a browser window and the server, but when it comes to communication between two browser windows, there are few libraries that can help you out there.

I’ve been working with jQuery for over a year now and have always wanted to give something back to the user community by releasing my own plugin. Unfortunately it seemed like every type of generic functionality I might ever need had already been developed by others. Until last night.

I was working on a webapp in which my main browser window had to open a popup window, and the user would then perform an action in this window. Upon completion of that action the main (parent) browser window needed to be notified.
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. This requires you to add form markup to your page, which is clunky. A second issue is that if you have several types of events or data to send to the other window, you’ll need to add an input field for each type. And a third issue I ran into is that ‘change’ events do not seem to fire for an input field if that field was updated by another window. ‘change’ or custom events using jQuery didn’t work either this way. ‘click’ events on links or buttons do work, but they would need to be hidden, otherwise the user could click on them too. I got it all working but this all started to look like an ugly hack, cluttering my pages with messy javascript and markup code.

Read More »