access to parent.document inside iframe

816 views Asked by At

inside an iframe app if we call "parent.document" we will get "Permission denied to access property 'document'" error. it seems that there is no way to make changes in the iframe parent document when domains are differrent.

i have traced the facebook "FB.ui" function result for example:

FB.ui({
    method: 'stream.share',
    u: 'www.example.com'
});

and found that after calling this function inside an iframe, the result dialog is just a < div > tag which is created dynamicaly inside the "parent.document" page.

so if access to parent.document is prohibited for iframes then how is it possible that facebook does such thing?

1

There are 1 answers

1
Dinkheller On

try: pNode = document.getElementById(thisNode).parentNode;