PHP Classes

File: assets/js/jquery.ajax-retry.min.js

Recommend this page to a friend!
  Classes of Ahmad Mustapha  >  Utility Web PHP API  >  assets/js/jquery.ajax-retry.min.js  >  Download  
File: assets/js/jquery.ajax-retry.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Utility Web PHP API
API to retrieve movie details and other resources
Author: By
Last change:
Date: 1 year ago
Size: 777 bytes
 

Contents

Class file image Download
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(b,c){var d=c.times,e=b.timeout;return function(f){function g(){a.ajax(h).retry({times:d-1,timeout:c.timeout,statusCodes:c.statusCodes}).pipe(i.resolve,i.reject)}var h=this,i=new a.Deferred,j=b.getResponseHeader("Retry-After");return d>1&&(!b.statusCodes||a.inArray(f.status,b.statusCodes)>-1)?(j&&(e=isNaN(j)?new Date(j).getTime()-a.now():1e3*parseInt(j,10),(isNaN(e)||0>e)&&(e=b.timeout)),void 0!==e?setTimeout(g,e):g()):i.rejectWith(this,arguments),i}}a.ajaxPrefilter(function(a,c,d){d.retry=function(a){return a.timeout&&(this.timeout=a.timeout),a.statusCodes&&(this.statusCodes=a.statusCodes),this.pipe(null,b(this,a))}})});
For more information send a message to info at phpclasses dot org.