Have been familiarizing myself with Jquery for about 6 months now. Finding a lot of uses for it, particularly Jquery’s Ajax tools.
When I use the .ajax() method to send info to a server side script, and the request fails for whatever reason, both the .ajaxerror() and the .fail handler will reliably return an error message, but both methods seem to want to hide my old familiar, unfriendly-but-specific ASP generated error messages.
In their place, I get a generic “internal server error” message. Any other Classic ASP dinosaurs out there know what I’m talking about?
Thanks in advance for any insight.
Use xhr.ResponseText provided in the $.ajax error callback function..
Here is an example.
NOTE! xhr.response text returns all the ugly html string representing the error page.
if you want to be more specific there is another option.
In you server side app use try and catch clause.
after you caught the error send it as a text to the response.write and then use response.end();
this is not the best way but it will work.
another option for you is to use json to structure your caught error message and response.write as well that way the XHR object will hold the information in a structured oop way.