Replace entire HTML document in-place
I'm trying to avoid using a data URI because I do not want the generated document to be stored in the browser's history. Is it possible to replace the entire HTML document in-place? I tried jQuery("html").html("<html>....</html>") , but the style information does not survive. You probably want to do this: jQuery("body").html("new content"); ...where "new content" would ideally only include the markup that would normally appear within the body element and not the rest. That will replace the body element's contents, whilst leaving anything you have in head (like style sheet information) alone.