[EMAIL PROTECTED] schrieb: > Hi, > > Simple question. How do I get the response text of an ajax call? Right now, > my call is returning an XMLHttpRequest object, but I don't know how to > extract the plain text that I'm expecting. here's the code > > var responseData = $.ajax({ > type: "POST", > url: url, > data: paramStr, > dataType: "text", > async: false, > error: function(request, msg){ > alert( "Error upon saving request: " + msg ); > }, > success: function(request) { > // alert( "Saved" ); > } > }); > alert(responseData); > var responseText = responseData.html(); > > As you may have guessed, there is a JS error on the last line of code. > > Thanks, - Dave
The success handler already gets passed the response text as argument: $.ajax({ type: "POST", url: url, data: paramStr, dataType: "text", async: false, error: function(request, msg){ alert( "Error upon saving request: " + msg ); }, success: function(r) { var responseText = r; } }); -- Klaus _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/