I'm using $.post to send a query to a JSP which returns some awesome data for me.
If the query is malformed, however, the page returns with "error on page" and an HTTP Status of 500 Internal Server Error
in jQuery, how can I detect this error so I can tell the user of the failure?
runQuery : function () {
$.post(
admin_stats.runQueryURL,
{
buster : Math.random,
statsQuery: admin_stats.getQuery(),
jsp: 'admin_statsQuery'
},
admin_stats.handleStatsQuery,
"html"
);
the returned data is an HTML table which is sufficient for this project at the moment.
Also: totally open to criticism if this is ugly or not the way I should be doing things =)