View Full Version : iframe problems
Jimbo
03-16-2003, 09:59 PM
In one of my pages I have an iframe. I can easily manipulate the parent window from the page within the iframe by using "parent.document.....". What I need to know is how to manipulate the the page in the iframe from the parent window. Thanks in advance
-Jimbo
cheesebagpipe
03-17-2003, 12:10 AM
It depends on what you want to do with it! For 'window-like' operations - like changing the src - reference it like this:
frames['frame_name']
...and, as an example, for <iframe name="IFR" id="IFR".....>
frames['IFR'].location = 'http://www.codingforums.com';
For 'element-like' tasks, try getting your handle with:
document.getElementById()
...as in:
document.getElementById('IFR').style.width = '100px';
Iframes are schizophrenic - part element, part frame (window), with two DOM objects representing them (I'm guessing at that last).
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.