How is it possible to add a .js file in my joomla module?
The directory structure is like this:
‘ “modulename”/site/js/thefileIneed.js ‘
I tried the following, but that doesn’t work.
$document = &JFactory::getDocument();
$document->addScript(dirname(__FILE__). '/site/js/mainscript.js' );
Thank you for your help.
If found this working example in one of our working modules: