title: Javascript : Continue execution after ajax error
body: <p>I'm trying to accomplish the following:</p>
  
  <ul>
  <li>On load of the page, the code should do a $.getJSON request (which
  basically is an ajax get request) (on success yayy just continue execution otherwise go down this list).</li>
  <li>when this fails with code 400 I would like to wait 1 second and retry this request (if this succeeds than yayy continue code execution otherwise go down this list)</li>
  <li>after that just skip the ajax get request and continue executing the other code.</li>
  </ul>
  
  <p>But Currently, I can't manage to continue to execute the code because of the thrown error. For this I tried :</p>
  
  <pre><code>try{
      $.getJSON('/services/getData').success(function(data) {
          configurationObject = data["configuration"];                            
      })
  } catch(err) {
      console.log("error");
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$.getJSON('/services/getData').success(function(data) {
      configurationObject = data["configuration"];                            
  })
  .error(function(){
      console.log("keep running please")
  }
  </code></pre>
  
  <p>but both just stops the execution of the complete javascript code. Is there any way I can keep running after an error occurred when using ajax calls?</p>