How to load JS scripts that will add only one additional script
<p>I have 2 script files that you put in the <code>&lt;head&gt;</code></p>

<p>However, they share the same Util script file.
I want that in case they are both loaded on the same page, the util file will load only once.</p>

<p>If only one of them is loaded, the util will still be loaded once...
I cant use <code>&lt;script src=...utils.js&gt;</code>... only the 2 scripts
I am using</p>

<pre><code>var s = document.createElement("script");
s.src = s3 + "/js_enc/utils.js";
s.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(s);
</code></pre>

<p>What is the best way to achieve this?</p>

<p>thanks</p>
