jellyfin-web/dashboard-ui/thirdparty/apiclient/ajax.js

24 lines
512 B
JavaScript
Raw Normal View History

(function (globalScope) {
globalScope.AjaxApi = {
2015-05-25 10:32:22 -07:00
param: function (params) {
return jQuery.param(params);
},
2015-05-25 10:32:22 -07:00
ajax: function (request) {
request.timeout = request.timeout || 30000;
2015-05-21 13:53:14 -07:00
try {
return jQuery.ajax(request);
} catch (err) {
var deferred = DeferredBuilder.Deferred();
deferred.reject();
return deferred.promise();
}
}
};
})(window);