Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // use:
- // $c.get('api/model', {})
- // .done(function(json) { alert("DONE"); console.log(json); })
- // .fail(function(json) { alert("FAIL"); console.log(json); });
- //
- $c.get = function(apiPath, params) {
- var thenDone = function(data) { return data; };
- var thenFail = function(jqXHR) { return jqXHR.responseJSON; };
- return $.get(apiPath, params).then(thenDone, thenFail);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement