title: Loading jQuery before other Javascript in Joomla 3
body: <p>I'm adapting a custom component to Joomla 3. It relies on jQuery, which I previously loaded in myself. Now that it's included in the base template, I don't need to. However, my custom javascript that relies on jQuery is being loaded first. I load them using the following form:</p>
  
  <pre><code>$document = JFactory::getDocument();
  $document-&gt;addScript( PATH TO SCRIPT);
  </code></pre>
  
  <p>This properly includes them in the <code>&lt;head&gt;</code> element, but they are loaded before jQuery.</p>
  
  <p>Some quick searching reveals <code>abstract class JHtmlJquery</code> in <code>libraries/cms/html/jquery.php</code> but I'm unsure of from where this is called.</p>
  
  <p>How can I change the load order so that jQuery is loaded before my scripts that depend upon it? And can I do this without getting into the core code?</p>