Solved

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

Posted on 2008-06-17
5
2,230 Views
Last Modified: 2013-11-05
How do i access the parent window element from an iframe?
0
Comment
Question by:baboa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 21804224
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
ID: 21804437
Neither window.parent.document.getElementById() nor top.document.getElementById() worked from the iframe.
0
 
LVL 82

Expert Comment

by:hielo
ID: 21804712
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
ID: 21805549
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
ID: 21805728
>>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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Fix Form size HTML 16 31
converting document.write() to innerHTML 7 53
selected value 16 26
isNaN issue on the Table input text 2 8
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

726 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