I'm writing a component in Joomla and want to use JavaScript.
I got the JavaScript part working in a separat test html page, but now I want to include it in the Joomla component.
The problem is the relative file paths for the images. The images are stored in the media folder of joomla:
media/com_component/images
I include the external js-file with this command:
$document->addScript(JURI::Root().'components/com_component/script.js');
In the script I need the path to the image folder. I don't want to hard code the absolute path in the script. How can I get the relative paths? Do/can I use Joomla functions for that?
Thank you