https://bugzilla.wikimedia.org/show_bug.cgi?id=36783

--- Comment #1 from Krinkle <[email protected]> 2012-05-15 08:50:07 UTC ---
I'm not sure what you are asking here.

The only mention of jqXHR is in the comments of mw.Api. The method itself is a
passthru from jQuery.ajax (the last line in both of the implementations is
"return $.ajax( opt );"

As of jQuery 1.5 jqXHR extends jQuery.Deferred() so it implements the promise
interface etc.

The following should work fine:

<code>
function myApiStuff() {
  var api = new mw.Api();
  return api.get( {}, ... );
}

var apiStuff = myApiStuff();
apiStuff.always( fn );
apiStuff.done( fn );
// etc.

</code>

See also http://api.jquery.com/jQuery.ajax/

A few things we could do in addition to that:
* Make the "ok" argument to mw.Api..get optional, so that one can use the
deferred methods without having to pass a bogus function as well.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to