title: Use SetInterval when the If condition is True
body: <p>Is this Possible that if the value of <strong>$new</strong> is changed then the var <strong>updateChart function</strong> reload again and then again it goes to the <strong>var check function</strong> and again have the same condition on it.</p>
  
  <pre><code>var updateInterval = 3000;
    var updateChart = function() {
        var check = function() {
          if(&lt;?php echo $new; ?&gt;).change(function(){
            setInterval(function(){updateChart()}, 1000);
          });
        }
      dps.push(&lt;?php echo $str; ?&gt;);
      chart.render();   
  };
  </code></pre>
  
  <p>Will be appreciated 
  Thanks.</p>