Im trying to get some html5 post messaging going with dojo 1.8, i’ve created a jsfiddle to try to explain it better. One thing to note is that the button is being loaded within the iframe. So basically if a click happens within the iframe then the parent node should receive and act upon the message. Any pointers would be appreciated.
Share
Basically, you should listen for
messageon iframe window, i.e.iframe.contentWindow. Also, please note there is nodojoin your iframe.I created a jsFiddle to show how it works: http://jsfiddle.net/phusick/H7Zh8/ but I’m afraid it is very messy to have everything in a single file, i.e. in the context of the parent window, because it does not explain properly where
windowreference points to and it does not simulate real world usage. I suggest you try it at localhost having two sets of scripts, one for parent window and one for iframe.