Is there any way for IFrame to IFrame communication through JavaScript
Is there any way for IFrame to IFrame communication through JavaScript
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.
If the iFrames share the same domain origin, you can directly call Javascript or read/write variables into each iFrame from the other. You get the iFrame object and get the web-page’s window object from that.
If the iFrames do not have the same origin, then modern browsers will prevent you from communicating with normal javascript. The only way to pass info is with messaging which is a relatively new browser capability and requires pre-cooperation among the code of both iFrames.