473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

controlling an iframe from another iframe within a frame

I need to know how to change the src property of an iframe from script
that is executed in another iframe with both of these iframes being
contained on a document which is then contained by another frame. I
have done a bunch of searching on these groups all to no avail.
I am new to javascript and learning so if someone can help me with
this I would appreciate it.
Jul 23 '05 #1
1 1874
What you need to learn to do is navigate the document hierarchy, which is
pretty simple once you get the hang of it. It should also be noted that
unless you're willing to work with one browser and one browser only, you're
not going to enjoy all the coding that makes this cross-browser compatible.
For IE only, if I have an HTML file with an iFrame and I want to refer to
that iFrame, I do this:

document.myFrame.location = "http://www.yahoo.com"

If I want to refer back to the document from my iframe, I do this in the
iframe code:

parent.somesetting.somevalue = 'some new value'

To refer to a second iframe from the first iframe:

parent.secondIframe.location = "http://www.google.com"

To refer to the containing frame of the parent document of either iframe:

parent.parent.someSetting.value = 'some new value'

See how that works for you...

- Wm

--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri

"James Wallace" <jw******@btutilities.com> wrote in message
news:a5**************************@posting.google.c om...
I need to know how to change the src property of an iframe from script
that is executed in another iframe with both of these iframes being
contained on a document which is then contained by another frame. I
have done a bunch of searching on these groups all to no avail.
I am new to javascript and learning so if someone can help me with
this I would appreciate it.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Thies | last post by:
I'm (still) having trouble reading the contents of an IFRAME (IE5). I have this: var my_iframe = document.frames; What I would want to do at that point is get either the...
3
by: Bob | last post by:
I'm a total newbie at Javascript, but a programmer for over 20 years... so, my plans may be bigger than they are possible. I'm trying to set with Javascript the value of a form field... easy...
3
by: Lans Redmond | last post by:
I have an iframe within a jsp page which displays rows from a database. I then have a checkbox where, when I check/uncheck the checkbox it performs operations on the rows listed in the frame. I...
6
by: Phlip | last post by:
JavaScripties: On the HTML side, we load an IFRAME with a blank page: <iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="off" src="about:blank" id="iframe_xml1!format_text"...
3
by: Alexandre Jaquet | last post by:
Hi I wanna know how can I reload an iframe does I've to move my iframe into another form an do a submit or may I can do it by another way rigth now I'm been doing : my form name is mainform...
4
by: christine.nguyen | last post by:
Hello, Here's the deal. I have an html page that contains an iframe. This iframe has an id that is unknown to me. This iframe also has test.html as it's source. Within test.html runs some...
2
by: ad | last post by:
What is the difference between iframe and frame? What is the situation to use iframe ?
3
by: Angel | last post by:
How do I get the reference of the IFrame from the asp.net webpage that is being displayed within that IFrame? In other words I have an IFrame in my page. Within that IFrame Set the source to a...
0
by: johnw182 | last post by:
Ok, I have a asp.net project. Everything works great. HOWEVER, this project was made to be called from within a frame or iframe. When being used within the iframe the user gets a blank frame when...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.