You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerScript('bar', 'com_example/bar.js', [], ['defer' => true], ['core']);
// And use it later
$wa->useScript('bar');
I noticed that I couldn't really control the position of js scripts (or css files) in the listing deployed in head when displaying page.
Sometimes, it could be necessary, eg when I want my css file to load AFTER template.min.css
With HTMLHelper, js scripts and css files are (almost) always positioned by the end of the listing, as I wish.
HTMLHelper::_('script', ...
or
HTMLHelper::_('stylesheet',...
Do I miss something somewhere ?
Other question, related:
Is it mandatory to create a joomla.asset.json file in media/myfiles when I just want to add some js or css to an existing extension?
The text was updated successfully, but these errors were encountered:
When using Web Assets basic method like this:
I noticed that I couldn't really control the position of js scripts (or css files) in the listing deployed in head when displaying page.
Sometimes, it could be necessary, eg when I want my css file to load AFTER template.min.css
With
HTMLHelper
, js scripts and css files are (almost) always positioned by the end of the listing, as I wish.or
Do I miss something somewhere ?
Other question, related:
Is it mandatory to create a joomla.asset.json file in media/myfiles when I just want to add some js or css to an existing extension?
The text was updated successfully, but these errors were encountered: