I see that they have added a function for status codes
statusCode (added 1.5) Card Default: {} A card of numeric HTTP codes and functions called when the response has the corresponding code. For example, the following warning when the response status is 404:
$.ajax({ statusCode: {404: function() { alert('page not found'); } });
If the request is successful, the code status functions take the same parameters as a success callback; if this leads to an error, they accept the same parameters as the error
I am wondering if you can do something like $.ajax({...}).statusCode(function(){...});
$.ajax({...}).statusCode(function(){...});
Simliar how can you do
var jqxhr = $.ajax({ url: "example.php" }) .success(function() { alert("success"); }) .error(function() { alert("error"); }) .complete(function() { alert("complete"); })
, . , , , , , , , - , HTTP, . . .
$.ajax({ url: "example.php" }) .statusCode({ 200: function(){ alert('success'); }, 404: function(){ alert('not found'); } });
Source: https://habr.com/ru/post/1795802/More articles:XAML Binding Groups - c #RSA calculation c ^ d mod n - encryptionHow to handle multiple Authenticator - androidDoes anyone know about a SaaS billing and authentication service? - authenticationWriting to a file does not work - objective-cХранение файлов на сервере в каталоге, не доступном для общего доступа - phpСписок сортировки, где объект IsNot Nothing - listhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1795805/apache-htaccess-forbidding-direct-access-to-a-file-but-allow-rewrites-to-go-there&usg=ALkJrhiNEt7aoiYCBX0dS3DmpGtUiGXyFgWhy is there a two-dimensional type error when calling WebMethod in an ASP.NET web application? - debuggingLost connection to MySQL server while "reading source communication packet", system error: 113 - phpAll Articles