Solved

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

Posted on 2008-06-17
5
2,223 Views
Last Modified: 2013-11-05
How do i access the parent window element from an iframe?
0
Comment
Question by:baboa
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
Comment Utility
the keyword "parent" refers to the parent window. IF you are interested in the top-most window, then "top" refers to said window.
0
 

Author Comment

by:baboa
Comment Utility
Neither window.parent.document.getElementById() nor top.document.getElementById() worked from the iframe.
0
 
LVL 82

Expert Comment

by:hielo
Comment Utility
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
 

Author Comment

by:baboa
Comment Utility
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
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
Comment Utility
>>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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now