title: How to add a timer to keep check for 500 error message untill it changes to a different message using jquery?
body: <p>I want to  keep checking for 500 error server message  and until the success message is  200 and i want it to time out after 2mins and give some message</p>
  
  <p>How can i do it codingly?</p>
  
  <p>here is my code below</p>
  
  <pre><code>$(document).ready(function() {
          $.ajax({
              url: "some.json",
              statusCode: {
                  500: function() {
                      alert(" 500  lower data still loading");
                      console.log('500 ');
                  }
              }
          }); 
  
  
      });
  </code></pre>