Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1439
  • Last Modified:

Calling javascript function from child iframe

Hi All,
      I need the answer to this question as soon as possible. It will be really great if someone reply to it quickly.
The question is as follows-
I have two iframes (say 1 & 2). The iframe 2 is inside iframe 1. There is a javascript function doSettings(user) inside iframe 1. I wanted to call this function from iframe 2 with the username as argument. Also, the iframe 1 is reloaded every 1 second.

thanks in advance,
uniquepawan
0
uniquepawan
Asked:
uniquepawan
1 Solution
 
ZylochCommented:
Hi uniquepawan,

Try using

parent.functionName(parameter);

Regards,
Zyloch
0
 
mlpk_tyrCommented:
hi,

try this,

since both frames are in a single window,

window.frames{'framename'}.callthefunction()


hope this helps,
mlpk_tyr
0
 
ZylochCommented:
mlpk, don't you mean window.frames['framename']?
0
 
oddersCommented:
yeah, ive been using parent.function(); quiet a bit and works welll in many browsers.
0
 
James RodgersWeb Applications DeveloperCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

Accept : Zyloch {12100007}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Jester_48
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now