title: How to handle my code when different jQuery object names are possible
body: <p>I have a simple function that I'd like to run on <code>$.ready</code>. The same function should run both on the frontend as well as on the admin pages. </p>
  
  <p>Problem happens on the admin pages because there the <code>jQuery</code> variable is not defined. Instead they define <code>django.jQuery</code>.</p>
  
  <p>How can I make my code fit both cases without polluting global namespace with an additional <code>jQuery</code> name?</p>
  
  <p>This is what I have so far, it works, but leaves the additional <code>jQuery</code> name in global scope:</p>
  
  <pre><code>if(typeof jQuery === 'undefined' &amp;&amp; typeof django !== 'undefined') {
     jQuery = django.jQuery;
  }
  jQuery(function($){...});
  </code></pre>