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 the iframe doctype using javascript.
Here is my code:
document.write("<iframe scrolling=\"no\" frameborder=\"0\">");
document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
document.write("<html>");
document.write("<head></head><body></body>");
document.write("</html>");
document.write("</iframe>");
document.write("</div>");
The iframe is created but I the doctype is not applied. is there a way to do this?
Thanks