How to run/load a separate javascript file selectively from inside javascript?
<p>I have 3 JavaScript files that I would like to load from an <code>index.html</code> file. I'm choosing among them by using <code>if</code> statements which I only know how to do in JavasSript. However when in a JavaScript body, it doesn't look like I can say something like:</p>

<pre><code>&lt;script type="text/javascript"&gt;
if(window.innerHeight == 800)
     &lt;script type="text/javascript" charset="utf-8" src="storybook.js"&gt;&lt;/script&gt;
</code></pre>

<p></p>

<p>Is there a function or something I could use to execute the JavaScript file after the conditional?</p>
