I have two iframes (iframe1 and iframe2) from the same domain, which are hosted in a document from different domain. How can i refer iframe1 from iframe2, so that they can communicate through postMessage().
I will answer it myself, postMessage()
is ideal for communication between an iframe and its parent document. But in my case it would be better to use sessionStorage
for communication between the iframes from the same origin.