title: javascript setInterval json request
body: <p>Below is the JavaScript code where it should count every 1 min but somehow counting every 20 seconds.</p>
  
  <pre><code>var tim = setInterval(doCount, 60000);
  var count = 0;
  var currency = "R$";
  var stopit = 0;
  function doCount() {
     stopit++;
     if (stopit &gt; 30) {
        $.ajax({
           url: "URL",
           cache: false,
           dataType: "json",
           success: function (json) {
              $.get("URL");
           },
           error: function (e, xhr) {
  
           }
        });
        return false;
     }
     count += 1.99;
     $("#number").html(
        currency +  parseFloat(count).toFixed(2).replace(/\./g, ',')
     );
     $.post("URL"});
  }
  </code></pre>