Include custom JavaScript

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
qson
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Mar 05, 2006 9:02 pm

Include custom JavaScript

Post by qson » Sat Feb 23, 2008 3:37 pm

I want to include custom JavaScript-files in my component. Where should I place these and how to include them?
JPATH_COMPONENT_SITE is a local path so I can't use that one. Can I place the js-files in components/com_component/media/js/ and then point to them by $this->baseurl.DS.'components'.DS.$GLOBALS['option'].DS.'media'.DS.'js'.DS;
?

Please help!

Post Reply