jellyfin-web/dashboard-ui/thirdparty/apiclient/ajax.js
Luke Pulverenti 4e86a39f8c 3.0.5621.2
2015-05-25 13:32:22 -04:00

24 lines
512 B
JavaScript

(function (globalScope) {
globalScope.AjaxApi = {
param: function (params) {
return jQuery.param(params);
},
ajax: function (request) {
request.timeout = request.timeout || 30000;
try {
return jQuery.ajax(request);
} catch (err) {
var deferred = DeferredBuilder.Deferred();
deferred.reject();
return deferred.promise();
}
}
};
})(window);