I have the appearance of a component that should include a .js file in the header (the header is created by Joomla, and not hardcoded in default.php). Frontend file - mysite.com/components/com_arrcard/views/tmpl/default.php; The javascript file is located at mysite.com/administrator/components/com_arrcard/js/CalendarPopup.js.
Here is what I tried in my default.php:
$document =& 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->addScript( JURI::root(true).'/administrator/components/com_arrcard/js/CalendarPopup.js' );
The variables $ popImage and $ popPhone are set correctly, but the script is not added - when I look at the displayed source of the page, CalendarPopup.js is nowhere.
Can anyone help me out? What am I doing wrong here? I also tried
$document->addScript('administrator/components/com_arrcard/js/CalendarPopup.js' );
. addScript , com_arrark . , addScript?