I have an IFRAME that should be filled with content from JavaScript. Had the content be on the server all I had to do is:
function onIFrameFill() {
Similar to Jeffry but using contentDocument instead.
contentDocument
let iframe = document.querySelector('iframe'); let doc = iframe.contentDocument; doc.open(); doc.write('Hello world!'); doc.close();