Recommended practice to manage .js and .css references
<p>Is there a way to detect whether a .js file was already being referenced in a html page?</p>

<p>Here's the scenario: a SharePoint page adds web parts that each one of them reference jQuery.js,</p>

<pre><code>&lt;script src="/_controltemplates/DummyProject/DummyWebPart/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>

<p>Thing is, this calls for trouble.</p>

<p>I'm thinking about creating a "dependencies web part" so all references go to it, and if someone needs to use web part A and B, they must add that one first.</p>

<p>But doesn't sound like an elegante solution. I'd love to have someone like in C where you can check in your include file for a #DEFINE _STDIO_H_ and if already defined just exit.</p>

<p>On a more general note - is there a pattern to follow there?</p>
