How to conditionally load a jQuery plugin?
<p>I have an asp.net UserControl that can be added multiple times to a page.  On this UserControl I am using a jQuery plugin that I would only like to load once.  I am using the following piece of code to conditionally load jQuery itself:</p>

<pre><code>if (typeof jQuery == 'undefined') {
    // load jquery 
    var script = document.createElement('script');
    script.type = "text/javascript";
    script.src = "/_layouts/SprocketValidator/jQuery.js";
    document.getElementsByTagName('head')[0].appendChild(script);
} else {
    //already loaded
}
</code></pre>

<p>Would there be an equivalent for checking if a jQuery plugin is undefined?  The plugin I am using is the <a href="http://digitalbush.com/projects/masked-input-plugin/" rel="nofollow">digitalBush masked input plugin</a>.</p>
