Why I can't call user function defined in script tags that uses external library : <pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Register&lt;/title&gt;
&lt;!-- Include CSS File Here --&gt;
&lt;link rel="stylesheet" href="css/style.css"/&gt;
&lt;!-- Include JS File Here --&gt;
&lt;script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.20.min.js"&gt;

    function dispatchRegister() {
       //Some AWS lib code 
    }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="container"&gt;
&lt;div class="main"&gt;
&lt;h2&gt;Put Your credentials&lt;/h2&gt;
&lt;form id="form_id" method="post" name="myform"&gt;
&lt;label&gt;registerUsername&lt;/label&gt;
&lt;input type="text" name="registerUsername" id="registerUsername"/&gt;
&lt;label&gt;registerPassword&lt;/label&gt;
&lt;input type="text" name="registerPassword" id="registerPassword"/&gt;
&lt;label&gt;registerEmail&lt;/label&gt;
&lt;input type="text" name="registerEmail" id="registerEmail"/&gt;
&lt;input type="button" value="Register" id="submit" onclick="dispatchRegister()"/&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I got error "<em>Uncaught ReferenceError: dispatchRegister is not defined</em>"
I suspect function is not in global scope but how I can get around that?</p>
