jquery.ajax-retry

WebJar for jquery.ajax-retry

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

jquery.ajax-retry
Последняя версия

Последняя версия

0.2.7
Дата

Дата

Тип

Тип

jar
Описание

Описание

jquery.ajax-retry
WebJar for jquery.ajax-retry
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/johnkpaul/jquery-ajax-retry

Скачать jquery.ajax-retry

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/jquery.ajax-retry/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>jquery.ajax-retry</artifactId>
    <version>0.2.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/jquery.ajax-retry/
implementation 'org.webjars.npm:jquery.ajax-retry:0.2.7'
// https://jarcasting.com/artifacts/org.webjars.npm/jquery.ajax-retry/
implementation ("org.webjars.npm:jquery.ajax-retry:0.2.7")
'org.webjars.npm:jquery.ajax-retry:jar:0.2.7'
<dependency org="org.webjars.npm" name="jquery.ajax-retry" rev="0.2.7">
  <artifact name="jquery.ajax-retry" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='jquery.ajax-retry', version='0.2.7')
)
libraryDependencies += "org.webjars.npm" % "jquery.ajax-retry" % "0.2.7"
[org.webjars.npm/jquery.ajax-retry "0.2.7"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : grunt-contrib-qunit jar [0.5.1,0.6)
org.webjars.npm : grunt-contrib-concat jar [0.4.0,0.5)

Модули Проекта

Данный проект не имеет модулей.

jQuery Ajax Retry

Retry ajax calls using the deferred API

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/jquery.ajax-retry.min.js"></script>
<script>
jQuery(function($) {
  //this will try the ajax call three times in total 
  //if there is no error, the success callbacks will be fired immediately
  //if there is an error after three attempts, the error callback will be called

  $.ajax(options).retry({times:3}).then(function(){
    alert("success!");
  });  

  //this has the same sematics as above, except will wait 3 seconds between attempts
  $.ajax(options).retry({times:3, timeout:3000}).then(function(){
    alert("success!");
  });  

  //this will only retry if the response status code matches the ones we specify
  $.ajax(options).retry({times:3, statusCodes: [503, 504]}).then(function(){
    alert("success!");
  });
});
</script>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!

Release History

(Nothing yet)

License

Copyright (c) 2012 John Paul
Licensed under the MIT license.

Версии библиотеки

Версия
0.2.7