jellyfin-web/dashboard-ui/apiclient/ajax.js
2015-06-30 13:21:20 -04:00

24 lines
515 B
JavaScript

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