cs0815
cs0815

Reputation: 17388

Replace the current page with HTML from AJAX call

Please vote to close this question. I am using a partial view now and things work perfectly!

I make a successful post. I understand that result here:

$(document).ready(function() {
    $('.pagination a').live('click', function() {
        $.post(this.href, $('form').first().serialize(), function(result) {

        });
        return false;
    });
});

...corresponds to the response body. So can I, and I know this sounds stupid, replace the current page with this HTML?

Upvotes: 2

Views: 4520

Answers (1)

David Houde
David Houde

Reputation: 4778

I am not sure if I am missing someting, but you should be able to place this in your callback:

$(window).html(result);

Upvotes: 3

Related Questions