title: jQuery recursive ajax poll using setTimeout
body: <p>This question is related to this: <a href="https://stackoverflow.com/questions/11223829/jquery-recursive-ajax-poll-using-settimeout-to-control-the-poll-interval">jQuery recursive ajax poll using setTimeout to control the poll interval</a>, but slightly different and I cannot figure out why.</p>
  
  <pre><code>function _poll(n) {
    $.ajax({
      url: "/check_status",
      type: "POST",
      data: {state: 0},
      success: function(xhr) {
         var data = $.parseJSON(xhr)
         if (data.status == 0) {
           poll(n)
         }
      }
    });
  }
  
  function poll(n) {
    setTimeout(_poll(n), 5000);
  }
  </code></pre>
  
  <p>Like the other question, the request is also sent out crazy.
  Thanks a lot for the help!</p>
  
  <p>Note, I have to use different names "poll" and "_poll" for other purposes.</p>