How to add CSS and Javascript to Your Joomla Extension

Home / blog / How to add CSS and Javascript to Your Joomla Extension

How to add CSS and Javascript to Your Joomla Extension

When creating a quality Joomla extension you will place your styles and javascript codes on seperate files.

Then here is the way to add those files in to the joomla extension the proper way.

$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root().’mod_name/css/stylesheet.css’);
$document->addScript(JURI::root(). ‘mod_name/js/script.js’);

This page is also available in: enEnglish

Recent Posts

Leave a Comment

 

Contact Us

Send us a quick message, we will get back to you as soon as we see it.

Start typing and press Enter to search