Check if javascript is already attached to a page?
<p>Is there any way to check if javascript file is already attached to the page by its file name.</p>

<p>For eg : </p>

<pre><code>if ("path-to-script/scriptname.js") already embeded
{
call related function
}
else
{
Append '&lt;script src="path-to-script/scriptname.js" type="text/javascript"&gt; &lt;/script&gt; '
call related function
}
</code></pre>

<p><strong>Basically I dont want 1 script to be attached twice on the same page.</strong></p>
