My design of a page forces me to refresh the whole page with html that I have loaded via ajax.
$(\'html\').replaceWith(data);
Gives me errors. A
Use body:
$('body').replaceWith(data);