title: $document->addScript not working
body: <p>I have a front-end component view that I need to include a .js file in the header of (header is being generated by Joomla, not hard-coded in default.php). The front-end component file is mysite.com/components/com_arrcard/views/tmpl/default.php; the javascript file is located at mysite.com/administrator/components/com_arrcard/js/CalendarPopup.js.</p>
  
  <p>Here's what I tried in my default.php:</p>
  
  <pre><code>$document =&amp; JFactory::getDocument();
  $popUrl = JURI::root(true).'/website/documents/ccv.html';
  $popImage = JURI::root(true).'/website/documents/cv_card.jpg';
  $popPhone = JURI::root(true).'/website/documents/phone.html';
  
  $document-&gt;addScript( JURI::root(true).'/administrator/components/com_arrcard/js/CalendarPopup.js' );
  </code></pre>
  
  <p>The $popImage and $popPhone variables are getting set correctly, but the script is not being added - when I look at the rendered page source, CalendarPopup.js isn't anywhere.</p>
  
  <p>Can anyone help me out? What am I doing wrong here? I've also tried</p>
  
  <pre><code>$document-&gt;addScript('administrator/components/com_arrcard/js/CalendarPopup.js' );
  </code></pre>
  
  <p>That doesn't work either. The addScript code does work when including the exact same file in a view in the administrator com_arrcard component. Is there some limitation on where addScript works?</p>