Is there a way to call a JavaScript function that is inside an IFrame from the parent?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That depends on the contents of the IFrame. If the content is from another domain then you’re out of luck, as most modern browsers have closed that loophole for cross-site attacks.
However, if the content is from the SAME domain then you can use it as it were simply another method on the IFrame
windowobject. If I recall correctly you can use something likewindow.frames["_your_IFrame_ID_"].window.functionOrMethodName().