There are already several similar questions, but they usually cover the relationship between parents and parents.
I, on the other hand, would like to be able to get some IFrame DOM properties. I do not want to manipulate anything. I only want to be able to read properties or DOM nodes. Things like attributes or content.
AFAIK this is not possible unless I use something like window.postMessage . As smart as this solution, it is based on event listeners. This requires the listener to be defined inside the IFrame, and that means changing the IFrame code. I want to avoid this.
If you want to make an Ajax cross-domain call, you can (if you have access) set the headers of the target server so that:
Access-Control-Allow-Headers:X-Requested-With Access-Control-Allow-Methods:POST,GET,DELETE,PUT,OPTIONS Access-Control-Allow-Origin:*
This is interesting enough for communicating with an IFrame. So my question is:
(How) can I access the cross-domain IFrame DOM properties?
Michal m
source share