mw.api.prototype.ajax and mw.api.prototype.post in JavaScript are offering 'err' and 'ok' in the ajaxOptions parameter to specify callbacks for error and success.
It might be worth replacing this with the use of jQuery.Deferred, so instead of returning the jqXHR objectd they could return a new Deferred object so one can assign several callbacks to them.
The jqXHR object shouldn't be of interest much I assume since it only tells about the ajax requests state and whether it failed, not about the api calls success. So the ajax can succeed but the api request could still have failed, this is not apparent when using the jqXHR object.
If people use the jqXHR for some reason code could break if we would change the return values.
Right now the 'ok' option is obligatory, we could change that so it isn't anymore and if it isn't provided, we would just return a custom deferred object.
Version: unspecified
Severity: enhancement