Repository navigation
getJSON and friends no longer fail silently
getJSON, postJSON, putJSON and deleteJSON swallowed every failure: the .catch only wrote to the console and never called responseFunction, so the caller had no way to know a request had failed. A server that accepted the connection but never replied left the call pending indefinitely, because fetch() has no timeout of its own.
responseFunctionis now always called. On a network failure, CORS rejection or timeout it receives{status: 0, data: null}.0is never a real HTTP status, so it can be used to tell a failed request apart from a 4xx/5xx reply.- Every request aborts after 15 seconds.
- A malformed JSON body no longer prevents the callback: the real HTTP status is passed through with
data: null.