This version is old school.
Please find jQuery plugins on npm.
jquery.ajaxRetry
by Daniel Herman
An ajaxPrefilter that adds the capability to have advanced retry logic for ajax calls while maintaining support for all variations of callbacks, including deferreds