tags:

views:

39

answers:

1

if I have a javascript variable:

var page = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"&gt;&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Example&lt;/body&gt;&lt;/html&gt;"

and I want to load that page, what do I do?

+5  A: 

By load, I assume you mean write the contents of page to the current document. If so,

document.write(page);

See http://javascript.about.com/library/blwrite.htm for some caveats to using this function.

Brad
I accepted this, though it's not working perfectly. In Firefox it is just hanging indefinitely trying to load the page, but if I stop it and refresh then it loads properly.
Brian Schroth