468,483 Members | 2,677 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,483 developers. It's quick & easy.

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 5121
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Dennis M. Marks | last post: by
5 posts views Thread by mike | last post: by
13 posts views Thread by ukrbend | last post: by
1 post views Thread by evanburen | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.