title: how to call javascript function from .html in a .js file
body: <p>Is it possible to call a javascript function from an .html file while in a .js file?  For example, I have this in my foo.js:</p>
  
  <pre><code>$(document).ready(function() {
      fn(); 
  })
  </code></pre>
  
  <p>And I want to call fn() which is in my index.html:</p>
  
  <pre><code>&lt;script type="text/javascript" src="js/foo.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  function fn() {
       .....
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>When I do this, it doesn't seem to be calling fn().</p>