Why can't I call JS function from external file while function works if directly in head?
<p>I would like to be about to call a JS function from an external file in the following way:</p>

<p><code>&lt;div class="some_class" onlick="someFunction();"&gt;&lt;/div&gt;</code></p>

<p>Whenever I try this, I get 'ReferenceError: someFunction is not defined' in the console.  If I put the function directly in the <code>&lt;head&gt;</code> of the page, it works.</p>

<p>If, instead of using <code>onclick</code>, I use </p>

<pre><code>$('.some_class').click(function() {...})
</code></pre>

<p>in the external file, it works too, so the error does not appear to be due to incorrectly referencing the external file.</p>

<p>Any thoughts on why this is happening?
Thanks for reading!</p>
