Advertisement
Guest User

Untitled

a guest
May 29th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. //
  2. // use:
  3. // $c.get('api/model', {})
  4. // .done(function(json) { alert("DONE"); console.log(json); })
  5. // .fail(function(json) { alert("FAIL"); console.log(json); });
  6. //
  7. $c.get = function(apiPath, params) {
  8. var thenDone = function(data) { return data; };
  9. var thenFail = function(jqXHR) { return jqXHR.responseJSON; };
  10. return $.get(apiPath, params).then(thenDone, thenFail);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement