testing now Astroid 2.4 and template One. On the site, I get twice loaded jQuery.
First by system in head:
secondly by Astroid in body:
I think, this happens, when some part of the system needs Joomla! jQuery and asks it (Joomla\CMS\HTML\HTMLHelper::_('jquery.framework'). Then Joomla! cares about loading jQuery first in head and then JS libraries for another parts (components, plugins, etc.).
Is there a way to disable loading of jQuery library by Astroid.
There is no problem if Astroid JS libraries need new version of jQuery (I usually run system plugin to change the obsolete Joomla! jQuery library to 3.4.1 or 3.5.1, so I can grant newest jQuery loaded by Joomla! for Astroid framework).
With system plugin, I can of course even disable it, but I just ask if there is some option for this.
I see that the libraries like jquery or bootstrap are loaded at the end of body tag. The problem is, Joomla! adds all libraries which may be dependent on these libraries (jquery, bootstrap, ...) into the head tag.
So the question is, if there is option:
a) to move all the scripts to head tag, so even other scripts loaded by Joomla! can be dependent on main libraries
b) or to move all the libraries loaded by Joomla! into the body tag below these main libraries so they can be dependent on them with right order?
It seems like this is not an optimal way. Because if Astroid
So if Astroid puts jQuery into the body, Joomla! puts it into the head, so it is loaded 2x.
I can disable loading of Joomla! jQuery e.g. with help of system plugin, but all JS libraries which are dependent on jQuery are added by Joomla! into the head, so jQuery will be not found if set in body.
I know by myself, that adding parameters everywhere is wrong but maybe in this case which is so critical part, there can be parameter to add JS into the head or body. (Of corse if Joomla! will paste JS automatically to body, such parameter is no more needed, but until Joomla! standard is head, ...)
JoomDev is not affiliated with or endorsed by Open Source Matters or the Joomla! Project. The Joomla! logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.