title: setinterval says not defined function but it is
body: <p>i have this function which i define inside HEAD:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;
  function live() {
      $.get("http://mydomain.com/script.php", function(data){
          var timer = data;
          var elm = document.getElementById("live");
          if (timer == 1){
           elm.style.display = 'block';
          } else{
           elm.style.display = 'none';
          }     
      });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>and then i do a loop like this at the very end of my document:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   setInterval(live,10000);
  &lt;/script&gt;
  </code></pre>
  
  <p>but i get an error saying live is not defined. Why is that? Could you please tell me what im doing wrong?</p>
  
  <p>Thank you.</p>