Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call Iframe function from parent? 1

Status
Not open for further replies.

xpblueScreenOfDeath

Programmer
Joined
Sep 1, 2004
Messages
87
How do I call a function in a Iframe from the parent page? Thanks.
 

In IE, you would do this:

Code:
document.frames['myIframe'].myFunc();

Assuming, of course, that your iframe had a name (or ID) of 'myIframe', which contained a javascript function called 'myFunc'.

Hope this helps,
Dan

 
Thanks Dan, that works. How do I do it for other browsers such as firefox? I tried the follow below, but it doesn't work.

Code:
document.getElementById("myFrame").myFunc();
 
Thanks a lot Dan. That was exactly what I was trying to look for. I could find it with google, but I you did. I guest I need to brush up on my googleing skills.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top