So I have an Iframe in which I hawe opened a html document with header and body. I have html string that I wish to use to replace original Iframes html body. How to do such thing?
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.
I believe that something to this affect will do the trick if the iframe is being served from the same domain as the page itself*.
*If it’s not, then you are hosed as the browser will prevent access to an iframe of a different domain for security reasons. Though you could also consider piping the content you need in the iframe through your own server and displaying it that way, which would then allow your javascript access to the iframe content, although it’s certainly not the most efficient.