title: Start and stop reloading a page with Javascript
body: <p>I am trying to reload a page every X amount of seconds with Javascript, I need to be able to hit a button to stop it and start it though</p>
  
  <p>So when you go to the page it will just start refreshing every 5 seconds, then you can hit a stop button.  Once stopped you can hit a start button to get it going again.</p>
  
  <p>I am not sure how I can do this, can someone help, so far all I got is this..</p>
  
  <pre><code>&lt;script&gt;
  
  function timedRefresh(timeoutPeriod) {
      setTimeout("location.reload(true);",timeoutPeriod);
  }
  timedRefresh(5000);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Just need a way to stop it and start it up again</p>