How to insert html in iframe
Hallo all: I need to insert an html string in an iframe as shown below:
....
var html = "<html><head><title>Titolo</title></head><body><p>body</p></body></html>" jQuery('#popolaIframe').click(function() { parent.$("#indexIframe")[0].documentElement.innerHTML = html; }); Is there any way to achieve this?
+4
6 answers
It looks like you can get a reference to the body, so I donβt understand why not:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_iframe_contentdocument
0