I have a string which looks like:
<html><head><title>example</title></head><body>some example text</body></html>
The document.open/write/close methods will do what you want:
var newDoc = document.open("text/html", "replace"); newDoc.write(myString); newDoc.close();
Unless you pass in the replace parameter, the document.open call adds page history. So users would have to click back twice to go to the previous page.