title: Stop setInterval
body: <p>I want to stop this interval in the <code>error</code> handler from running repeatedly. Is that possible, and if so, how? </p>
  
  <pre><code>// example code
  $(document).on('ready',function(){
      setInterval(updateDiv,3000);
  });
  
  function updateDiv(){
      $.ajax({
          url: 'getContent.php',
          success: function(data){
              $('.square').html(data);
          },
          error: function(){
              $.playSound('oneday.wav');
              $('.square').html('&lt;span style="color:red"&gt;Connection problems&lt;/span&gt;');
              // I want to stop it here
          }
      });
  }
  </code></pre>