473,803 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1902
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.myFram e.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.somesett ing.somevalue = 'some new value'

To refer to a second iframe from the first iframe:

parent.secondIf rame.location = "http://www.google.com"

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

parent.parent.s omeSetting.valu e = 'some new value'

See how that works for you...

- Wm

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

"James Wallace" <jw******@btuti lities.com> wrote in message
news:a5******** *************** ***@posting.goo gle.com...
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
5965
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 contentWindow.document or the contentDocument depending on whether this was IE or Mozilla. (Thanks Lasse.) I'm not finding this.
3
2616
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 enough, right? e.g. this successfully sets the local form's field: document.thetestform.mycity.value='paris';
3
1587
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 get a jscript "undefined" error if 1 row is returned in the iframe. If I have more that 1 then my length for the iframe shows the amount. if only 1 row is the iframe then my length comes up undefined
6
18719
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" name="iframe_xml1!format_text" width="90%" height=" 180 ">Your browser is inferior and doesn't support IFRAMEs.</iframe> Later, a button click populates this frame:
3
11183
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 and my iframe name is preview function urlRewrite () { ... this.document.mainform.preview.src = 'xxxx'; }
4
28011
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 javascript. Within this javascript that runs in test.html, I want to obtain the id of the iframe that loaded test.html in the first place. Is this possible?? I have no control over the iframe at all. The iframe will be loaded on some random html...
2
6472
by: ad | last post by:
What is the difference between iframe and frame? What is the situation to use iframe ?
3
8141
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 different asp.net page. I want on that page that is within the IFrame to be able to access the IFrame object. How can that be done? Besides the reference to the IFrame but also certain other objects that are in the Host page of the Iframe. thanks...
0
1510
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 clicking certian buttons. Here is the code for the iframe. <iframe src="http://www.website.com/?cid=A195E1A9-A5D7-4046-89A4-1C00D4F81E35" id="frameName" frameborder="0" width="550" height="750"></iFrame> Here are the steps taken to reproduce.
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10309
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.