title: Repeat jQuery ajax request
body: <p>I make an ajax request to the server. And sometimes I receive 502 error. So, if that happened error() method is called.</p>
  
  <p>How can I repeat request if receive an error? The code should looks like this:</p>
  
  <pre><code>$.ajax({
                  url: 'http://server/test.php',
                  type: 'GET',
                  dataType: 'jsonp',
                  cache: 'false',
                  timeout: 32000,
                  success: function(data) {
                    //some actions here
                  },
                  error: function(jqXHR, textStatus, errorThrown) {
                      console.log("Error[refresh]: " + textStatus);
                      console.log(jqXHR);
                      // here I want to repeat the request like "this.repeat()"
                  },
              });
  </code></pre>