473,394 Members | 1,752 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,394 software developers and data experts.

Calling a function in an iframe

How do I call a function within an iframe from the container main document ?

Many thanks in advance,

Aaron
Mar 12 '07 #1
4 5292
Aaron Gray said the following on 3/12/2007 1:21 PM:
How do I call a function within an iframe from the container main document ?
iFrameRef.functionName();

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 12 '07 #2
"Randy Webb" <Hi************@aol.comwrote in message
news:Bt********************@giganews.com...
Aaron Gray said the following on 3/12/2007 1:21 PM:
>How do I call a function within an iframe from the container main
document ?

iFrameRef.functionName();
I was using the "name" attribute rather than "id" on the IFrame !

Aaron
Mar 12 '07 #3
ASM
Aaron Gray a écrit :
"Randy Webb" <Hi************@aol.comwrote in message
news:Bt********************@giganews.com...
>Aaron Gray said the following on 3/12/2007 1:21 PM:
>>How do I call a function within an iframe from the container main
document ?
iFrameRef.functionName();

I was using the "name" attribute rather than "id" on the IFrame !
iFrameref = parent.myIframeName;

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Mar 12 '07 #4
On Mon, 12 Mar 2007 19:34:42 +0100, Aaron Gray <an********@gmail.com
wrote:
"Randy Webb" <Hi************@aol.comwrote in message
news:Bt********************@giganews.com...
>Aaron Gray said the following on 3/12/2007 1:21 PM:
>>How do I call a function within an iframe from the container main
document ?

iFrameRef.functionName();

I was using the "name" attribute rather than "id" on the IFrame !

Aaron

var theIFrame = document.frames["theFrameName"];
if((theIFrame)&&(theIFrame.theFunction))
{
var theResult = theIFrame.theFunction();
}

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 16 '07 #5

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

Similar topics

1
by: Christian Radermacher | last post by:
Hi, the following code has the mentioned behaviour: <html> <head> <script type="text/javascript"> function newA() { for (i=0;i<3;i++) { var a = window.frames.document.createElement("a");
3
by: Dennis M. Marks | last post by:
I have a function that displays a list extracted from a table using document.write. In the displayed list I want to have a link that will call the same function but display the list in reverse. ...
4
by: nec | last post by:
Hi, I'm having trouble calling a function thats located in a iFrame from the parent. Shortly, i can't figure out the location in DOM. In IE it works fine with a simple line of...
9
by: Ragnorack67 | last post by:
.... <div id=work>hello</div> .... <IFRAME id="thisframe" src="./something.htm"></IFRAME> <script>
2
by: Randell D. | last post by:
Folks, I have got this working before, in part with some help from this ng but I never really understood how I got it working... and last time, I was using it via a popup window as opposed to an...
5
by: mike | last post by:
If I have a document like: <script> function mike_test() {alert('hi');} </script> <iframe src="blank.html" id="my_iframe1"> </iframe> and in blank.html I have:
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
1
by: evanburen | last post by:
I have an iframe inside of a parent page. How do I call the onChange function in the parent page from the ddlProfileNames dropdown in the iframe page? Thanks. code in parent page: <SCRIPT>...
1
by: Hocco | last post by:
Hello Everyone, Please help the novice in java scripting. I'm trying to call changeSection (x, y) function from the iframe. Basically I have my code and my iframe tag in index.html. Then I click...
9
by: Cainnech | last post by:
Helo everybody, I'm having a problem with a functioncall from my iFrame. I have a page which houses an iframe. The contents of that is being generated in the script and has the following output:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.