Communicating with Embedded Map Apps
Sometimes you want to embed a mapping application into a separate application via an iframe element. You may want to embed in a dashboard application or some other application related to the data on the map, but the map is not the main focus of the application.
The question at this point becomes how can you communicate with the map when you need to?
You can use postMessage to handle that communication pretty easily. If you wanted to add some sort of data validation or have some more control of the messages as they are passed around, you could initialize a web worker to send the messages.
It really depends on what your particular needs are to be able to communicate with embedded mapping applications. You can even run two different version of the ArcGIS API for JavaScript and communicate between them.
So sit back and check out the following video for a demonstration on Communicating with Embedded Map Apps.