daepark / postmessage

window postmessage plugin for cross-window messaging
http://postmessage.freebaseapps.com
179 stars 55 forks source link

Not working for multiple pm() calls. #3

Open spvasista opened 13 years ago

spvasista commented 13 years ago

in system 1 i have : [code]

[/code]

In system 2 i have:

For the first click of button it is working. when i click different or same button again it is not.

daepark commented 13 years ago

Multiple calls are working as you can see here: http://postmessage.freebaseapps.com/ example 2. Click the button multiple times and messages are sent and received.

As for you example code, A simpler example would be better to demonstrate your use case. For example, instead of inserting the iframes dynamically, can you create them beforehand. Also, I noticed in your server code (system 2), $.post is an asynchronous method but you are returning data that may or may not have been modified by your $.post callback.

spvasista commented 13 years ago

Daepark,thank you very much for your quick reply. I have a requirement of adding dynamic iframes. Do you think that is causing the problem? Where should I call unbind? Above pm.bind is called right? Where can i get a bit detailed explanation of this pm.bind and pm.unbind process as it accesses other domain(or code in other page) and different from normal bind. I am thanking you priorly for any of your reply on this.