How to auto refresh page
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3099430/automatic-page-refresh">Automatic page refresh</a>  </p>
</blockquote>



<p>I found this on and off switch online and would like to use it to refresh a page. If the user click the "on" it will refresh the page every 5 seconds. If they click off it will stop. Can some please help me out. Here's what I have so far: </p>

<pre><code>&lt;style&gt;



body{
font-family:Verdana, Geneva, sans-serif;
font-size:14px;}

.left{
float:left;
width:120px;}

#ajax{
float:left;
width:300px;
padding-top:5px;
font-weight:700;
}

.clear{clear:both;}

&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;


&lt;/a&gt;&lt;/div&gt;
&lt;div id="container"&gt;


 &lt;div class="left" id="1"&gt;&lt;/div&gt;
 &lt;div id="ajax"&gt;&lt;/div&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;

  &lt;script type="text/javascript"&gt;

    $('#1').iphoneSwitch("on", 
     function() {
       $('#ajax').load('on.html');
      },
      function() {
       $('#ajax').load('off.html');
      },
      {
        switch_on_container_path: 'iphone_switch_container_off.png'
      });
  &lt;/script&gt; 
</code></pre>
