title: Jquery poll request only if variable != 'something'
body: <p>I have this code:</p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          (function poll(){
              setTimeout(function(){
                  var process_id = $("#form3_progress_process_id").val();
                  if(process_id != 'undefined') {
                      $.ajax({
                          type: "POST",
                          url: "grab.php",
                          data: "action=step3_progress&amp;process_id=" + process_id,
                          success: function(data){
                              console.log("successful");
                          }, dataType: "json", complete: poll, timeout: 30000 });
                  }
              }, 2000);
          })()
      });
  &lt;/script&gt;
  &lt;input type="hidden" id="form3_progress_process_id" value="undefined"&gt;
  </code></pre>
  
  <p>What i want is that it only sends the query if the value from the input <strong>form3_progress_process_id</strong> is not '<strong>undefined</strong>'.</p>
  
  <p>At the start it is "<strong>undefined</strong>" but after some time it get's changed with jquery.</p>
  
  <p>However, the above code does not work for any reason. It does not start sending the request after the value has been changed.</p>
  
  <p>What did i wrong?</p>