title: jQuery: Run AJAX every X seconds for only 60 seconds?
body: <p>I'm trying to run AJAX for lets say every 5 seconds and then stop the whole ajax call after 60 seconds so there won't be any ajax call every 5 seconds after we reached the 60 seconds.</p>
  
  <p>I'm not sure if this is possible at all!</p>
  
  <p>I can easily run my ajax every 5 seconds like so:</p>
  
  <pre><code>    setInterval(function(){ 
  
   $.ajax({url: 'PHP-PAGE.php', success: function(result){
  
      }});
  
       }, 5000);
  </code></pre>
  
  <p>Is there any way to start the 60 seconds count down within the ajax and stop the whole ajax call after we reached the 60 seconds?</p>
  
  <p>Any help would be appreciated.</p>