How is it possible for a script within an <iframe> to have any notion of the page containing it? Can a script in the frame access any context outside of it? What about cross-domain?
Up until now I believed an <iframe> is completely agnostic to the containing page, but I have seen an example which contradicts this belief.
What exactly can and can’t be done from within an <iframe> with respect to the containing page?
If the content of the iframe and its parent have the same domain, you can access the parent pages DOM from the iframe by using
parent.document.getElement....However you can’t do this cross-domain (not even across different subdomains) as it will result in: