0

I'm looking for a way to change the html content of my entire page (even the head) , after an ajax call.

So I can't use :

$("body").html(result)

I have this code :

$.ajax({
url: myURL,
type: "POST",
success: function (result) {
   document.open();
   document.write(result);
   document.close();
}

But it's reloading the page. I don't want it because the transition is bad (my pages background color is black and there is a white flash during the refresh).

I need something like :

$("html").html(result)

But it doens't works. Is there a way to do it ?

Gab
  • 1,861
  • 5
  • 26
  • 39

0 Answers0