title: $(document).ready + setInterval = multiple instances running
body: <p>My web app currently uses this to kick off notifications retrieval in client-side:</p>
  
  <pre><code>$(document).ready( getNotifications() );
  </code></pre>
  
  <p>which is great, but i need it to run every XXX seconds, so I've added a setInterval timer at the end of <code>getNotifications()</code>, here:</p>
  
  <pre><code>function getNotifications() {
  
      //(do stuff)
  
      //now repeat every X seconds (10000 = 10s)
      setInterval(getNotifications, 30000);
  }
  </code></pre>
  
  <p>problem -- doing this seems to trigger multiple instances of the timer-loop'd function. using an alert() I can see that every timer cycle creates a new instance set to the timer, not an iteration of the same instance as desired.</p>
  
  <p>how can i get a timer/loop for my functionality without multiple instances?</p>
  
  <p>thanks!</p>