jquery how to get the status message returned by a ajax call of type post? jquery how to get the status message returned by a ajax call of type post? apache apache

jquery how to get the status message returned by a ajax call of type post?


Got it. It's jqXHR.statusText.

$.get("test.php").complete(function(jqXHR) {    console.log(jqXHR.statusText);});

Just tried it out in Chrome with your exact PHP code.


Have you tried xhrobject.getResponseHeader() yet? jQuery docs say it's also available there. If you don't know the header's name, try getAllResponseHeaders().

Also, can you see that message in your browser's debugging console (network tab, connection headers)? If it's not there, it will hardly be available from js.