How to call javascript function from <script> tag? : <pre><code>&lt;html&gt;
 &lt;script&gt;
    //some largeFunction()

    //load a script dynamically based on the previous code
    document.write("&lt;script src='//...'&gt;&lt;\/script&gt;");
 &lt;/script&gt;
&lt;/html&gt;
</code></pre>

<p>Question: is it possible to move the <code>largeFunction()</code> out of the static <code>html</code> page and put it into a <code>js</code> file? If yes, how could I then call that function statically before writing the <code>&lt;script&gt;</code> tag?</p>
