m
apiCall(onSuccess, onError)
лучше, чем
apiCall(onResponse)
onResponse {
if success {
...
else
...
}
}
спуститесь ниже, до
$.ajax(endpoint_url).then(OnSuccess).catch(OnError)
$.ajax(endpoint_url).then(OnResponse).catch(OnServerError)
Size: a a a
m
apiCall(onSuccess, onError)
apiCall(onResponse)
onResponse {
if success {
...
else
...
}
}
$.ajax(endpoint_url).then(OnSuccess).catch(OnError)
$.ajax(endpoint_url).then(OnResponse).catch(OnServerError)
m
AG
m
$.ajax(url, onError: function() { $errorDiv.innerText = 'Мы не смогли загрузить список =(' })
AG
AG
AG
m
AG
m
AG
DS
AG
AG
DS
m
DS
AG
m