3

I have a client suggesting I implement an old version of easyXDM to do send simple cross-domain messaging from iframe content to its parent window. My minimum browser requirements are IE11 and up.

Why should I use this over something like window.postMessage?

bingo
  • 2,298
  • 1
  • 15
  • 21

1 Answers1

-1

I think you are not able to achieve what you want using easyXDM, as the documentation states:

easyXDM provides a transport stack capable of passing string based messages between two windows, a consumer (the main document) and a provider (a document included using an iframe).

easyXDM docs

This implies that you can send messages from the parent window to the included iframe, but not the other way around.

That is reason enough to stick to the window.postMessage approach.

F. Santiago
  • 842
  • 10
  • 18
  • 1
    No. You can send messages either direction. EasyXDM uses window.Postmessage as its actual implementation for modern browsers, but falls back to old ways of achieving the same end for older browsers. – bingo Aug 30 '16 at 16:51
  • You are right. It does both ways and even allows methods to be called both ways, which is great. – F. Santiago Sep 13 '16 at 15:21