How do i access the parent window element from an iframe?

How do i access the parent window element from an iframe?
baboaAsked:
Who is Participating?
 
hieloCommented:
>>We are working with the restriction that the page on the iframe is NOT the same domain
OK, then to answer your question directly: You can't access the content of the parent frame. The browser will not let you due to security restrictions. There are many things that the browser will not let due to security concerns. This is one of them.
0
 
hieloCommented:
the keyword "parent" refers to the parent window. IF you are interested in the top-most window, then "top" refers to said window.
0
 
baboaAuthor Commented:
Neither window.parent.document.getElementById() nor top.document.getElementById() worked from the iframe.
0
 
hieloCommented:
Are you getting any errors? Is the page on the iframe from the same domain as the parent page? They MUST be from the same domain.
0
 
baboaAuthor Commented:
Sorry, I should have clarified. We are working with the restriction that the page on the iframe is NOT the same domain as the parent page. We cannot put them on the same domain.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.