Although I would not recommend showing the user the error number with the actual error message, so you can do this by adding the error callback
error: function(xhr,err){ alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status); alert("responseText: "+xhr.responseText); }
xhr is an XmlHttpRequest.
readyState : 1: download, 2: download, 3: interactive, 4: full.
status - HTTP status number, i.e. 404: not found, 500: server error, 200: ok.
responseText is the response from the server - it can be text or JSON from the web service or HTML from the web server.
Manseuk
source share