title: JavaScript - jQuery interval
body: <p>I am using JavaScript with jQuery. I have the following script to alert <code>hi</code> every 30 seconds.</p>
  
  <pre><code>$(document).ready( function() {
      alert("hi");
  setInterval(function() {
      alert("hi");
  }, 30000);
  });
  </code></pre>
  
  <p>I want to alert <code>hi</code> when the page loads (when document / page gets completely loaded) and on every 30 seconds interval afterwards (like <code>hi</code>(0s) - <code>hi</code>(30s) - <code>hi</code>(60s).. etc). But my solution works on two instances. One on DOM ready and the other in a loop. Is there any way to do the same in a single instance?</p>
  
  <p>You can see my fiddle <strong><a href="http://jsfiddle.net/blasteralfred/kejJC/" rel="noreferrer">here</a></strong>.</p>