I am having problems with ajax requests and server responses:
$.ajax({ url: servurl, dataType: "jsonp", data: {... }, crossDomain: true, error: function(){}, success: function(){}, complete: function(){alert('complete')} }); }
The fact is that sometimes I get success when I need it, but sometimes I can get the status of 500, and this is normal and expected. The same ajax call works for correct requests, but is not suitable for others. I want to show an error message if I get a 500 server error, but for some reason ajax does not exit. Thus, neither error: nor complete: work. Maybe the reason for this is the jsonp data type? However, other data types do not work. Can anyone help?
Or maybe give me advice on how to determine server status in any other way.
source share