fbpx

Trick or Treat - 30% OFF - Coupon Code: SCARY20 Download Now

Welcome, Guest
Username: Password: Remember me

TOPIC: Astroid 2.4 - Template One - 2x jQuery loaded

Astroid 2.4 - Template One - 2x jQuery loaded 1 month 3 weeks ago #23907

  • Phoca
  • Phoca's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 3
  • Karma: 0
Hi,

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.

Thank you, Jan
Phoca Cart - eCommerce platform for Joomla! CMS
Last Edit: 1 month 3 weeks ago by Phoca.
The administrator has disabled public write access.

Astroid 2.4 - Template One - 2x jQuery loaded 1 month 3 weeks ago #23939

  • Phoca
  • Phoca's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 3
  • Karma: 0
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?

Jan
Phoca Cart - eCommerce platform for Joomla! CMS
The administrator has disabled public write access.

Astroid 2.4 - Template One - 2x jQuery loaded 1 month 3 weeks ago #24011

  • nishtha
  • nishtha's Avatar
  • Online
  • Moderator
  • Posts: 1409
  • Thank you received: 137
  • Karma: 18
Hi,

Thank you for raising your concern, here's a detailed description of what you would want to know: github.com/joomdev/Astroid-Framework/wik...in-Astroid-Framework

Let us know if things are clear or you have anymore questions for us.

Thanks,
Nishtha
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The administrator has disabled public write access.

Astroid 2.4 - Template One - 2x jQuery loaded 1 month 3 weeks ago #24022

  • Phoca
  • Phoca's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Thank you received: 3
  • Karma: 0
Hi,

thank you for this link.

It seems like this is not an optimal way. Because if Astroid
So according to the best practices of the industry, we put our JavaScript at the bottom

adds JavaScript at the bottom, Joomla! does the opposite.

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.

BTW - I don't solve my personal situation, I can solve it for my needs, I just ask for community using Astroid. Because the common practice in Joomla! is, that it gives all libraries to head automatically and if some basic libraries which cannot be loaded twice on the site (jQuery, Bootstrap, ...) are set in body, they are not found by all the Javascript libraries added by Joomla! system into the 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, ...)

Jan
Phoca Cart - eCommerce platform for Joomla! CMS
Last Edit: 1 month 3 weeks ago by Phoca.
The administrator has disabled public write access.
Moderators: chandandeep
Time to create page: 0.304 seconds