title: Refresh iframe when no user activity
body: <p>Updated Code</p>
  
  <pre><code>        &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
      &lt;head&gt;
      &lt;meta content="text/html; charset=utf-8;" http-equiv="Content-Type;" /&gt;
      &lt;meta http-equiv="Cache-Control" content="no-cache" /&gt;
      &lt;meta http-equiv="Pragma" content="no-cache" /&gt;
      &lt;meta http-equiv="Expires" content="0" /&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
       //This goes into a script tag in your head tag
       var docTimeOut;
  
       function bodyTimeOut() {
           docTimeOut=setTimeout("updateFrame();",10000);
       }
  
       function resetTimeOut() {
           //alert('reset!');
           clearTimeout(docTimeOut);
           bodyTimeOut();
       }
  
       function updateFrame() {
           //Loads the page's html into the div
           //Uncomment this in your actual code
           $.get('https://www.creator.zoho.com/somePage/', function(data) {
               $('openPrintRun').html(data);
           });
           //alert('update!');
       }
  
       //This function runs when the DOM has finished loading
       $(function() {
           bodyTimeOut();
           //This binds the resettimeOut function the click, mousemove and mouseover events of the div
           $('#openPrintRun').bind('click mousemove mouseover', resetTimeOut);
       });
          // --&gt;
      &lt;/script&gt;
  
  
      &lt;title&gt;Untitled 1&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
        &lt;div class="openPrintRun" style="height:250px; width:100%;"&gt;
        &lt;/div&gt;
       &lt;/body&gt;
  
      &lt;/html&gt;
  </code></pre>
  
  <p>I have an iframe that I want to refresh when there is no user activity. At the moment I am trying to use this:</p>
  
  <pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
  &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
  &lt;script type="text/javascript"&gt;
  var docTimeOut;
  function bodyTimeOut()
  {
      docTimeOut=setTimeout(function(){location.reload();},1200);
  }
  
  function resetTimeOut()
  {
      clearTimeout(docTimeOut);
      bodyTimeOut();
  }
  
  
  document.onload = bodyTimeOut;
  
  document.getElementById('openPrintRun').onmouseover= resetTimeOut;
  &lt;/script&gt;
  &lt;title&gt;Untitled 1&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;iframe id="openPrintRun" height='250px' width='100%' name='zoho-Open_Print_Runs' frameborder='0' scrolling='auto' allowTransparency ='true' src='somepage.html'&gt;&lt;/iframe&gt;  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>But it does not seem to work. Is there a better or at least a correct way to do this?</p>