Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use JQuery.Load() to replace the entire document?

    $(document).load("somepage.aspx", function (responseText, textStatus, xhr) {

});

This is not working.
Is there any way to use the load function to replace the entire document including the head?

EDIT: I don't want to refresh my page, I have to use AJAX.

like image 880
Adir Avatar asked Jun 02 '12 14:06

Adir


1 Answers

$.get("somepage.aspx", function (data) {
    document.open();
    document.write(data);
    document.close();
    $.cache = {};
}, "text");
like image 108
Esailija Avatar answered Sep 25 '22 20:09

Esailija