Avoiding polluting the global namespace with javascript dependencies
<p>I'm building a javascript library and would like to bake in various dependencies (e.g, jQuery, Google Closure, etc) without polluting the global namespace.  This is particularly important because others may already be using different versions of these libraries.</p>

<p>As far as I can tell most of these libraries attach themselves directly to the <code>window</code> object, so I cannot simply put them in an anonymous function. </p>

<p>Are there any general solutions to this problem?</p>
