Get success respose in ajaxSuccess?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
cohq82
Forum Commoner
Posts: 43
Joined: Mon Apr 21, 2008 8:38 pm

Get success respose in ajaxSuccess?

Post by cohq82 »

I am using $.ajax in jQuery and I have some thing running in $().ajaxSuccess(function(event, request, settings) {});

However I don't know how to get the html as in response of the success callback below:

success: function(html) {});

How to pass html over to ajaxSuccess?

I know I can insert a line to assign html var to another global variable but is there a different way?
Thanks.
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Get success respose in ajaxSuccess?

Post by kaszu »

Request object has reponseText property

Code: Select all

$().ajaxSuccess(function(event, request, settings) {
    alert(request.responseText);
});
Post Reply