How to replace the entire html webpage with ajax response?

If your response includes the <head> and <body> tags:

$("html").html(response);.

If not, and it’s only content, then do:

$("body").html(response);.

Leave a Comment