Skip to content

Overload method for $.ajax that provides the ability to try the request over if it fails the first time.

Notifications You must be signed in to change notification settings

WP-Results/jQuery.retryAjax

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jQuery.retryAjax

Overload method for $.ajax that provides the ability to automatically try the request over if it fails the first time.

Usage

<script type="text/javascript" src="dist/jquery.retryAjax.min.js"></script>
<script type="text/javascript">
	// Implments everything in $.ajax 
	// Overrides complete method, so be sure not to use that...
	$.retryAjax({
		url: DESTINATION,
		timeout: 5000,
		retryLimit: 1,
		done: function() {
			alert("It worked!");
		}, 
		fail: function() {
			// fires after the last try is unsuccessful
		}
	});
</script>

About

Overload method for $.ajax that provides the ability to try the request over if it fails the first time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%