I\'m building a widget that can be embedded in other sites. The widget is an iframe that is created using document.write() however I don\'t know how to apply th
document.write()
You could also use an HTML5 srcdoc attribute to specify your iframe's content.
srcdoc
document.getElementById('myFrame').srcdoc = "
You'll have to check if srcdoc is supported by your browser.