Skip to Content Skip to Menu

[SOLVED] prevent CB to load jQuery via J_JQUERY_LOADED

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 4 months ago - 10 years 4 months ago #246419 by carin
How do I implement J_JQUERY_LOADED in my template to prevent CB from loading jQuery?

CB 2.0
Last edit: 10 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246468 by krileon
Replied by krileon on topic prevent CB to load jQuery via J_JQUERY_LOADED
You don't, CB needs its jQuery. If you prevent it from loading you're basically guaranteed to have issues. CB loads its jQuery in a deep noconflict so it can't break from multiple jQuery on the same page. CB 1.x also uses an older release of jQuery as newer releases of jQuery are not backwards compatible enough and will cause some jQuery to break. CB 2.0 has up to date jQuery release.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 4 months ago #246491 by carin
Thats unfortunate if you want to optimize loading time since the site has to load the (almost) same lib twice.

But CB 2.0 will come with an option to load or not to load jQuery I hope?

CB 2.0

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246514 by krileon
Replied by krileon on topic prevent CB to load jQuery via J_JQUERY_LOADED

Thats unfortunate if you want to optimize loading time since the site has to load the (almost) same lib twice.

The compressed jQuery file is roughly 100kb. You should have no performance impact. We're also looking into built in merging and further compression when our jQuery loads. This would be done on same directory by directory basis to prevent relative URL issues.

But CB 2.0 will come with an option to load or not to load jQuery I hope?

No, we opted not to allow this as it caused too many compatibility issues.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
10 years 4 months ago #246518 by carin

The compressed jQuery file is roughly 100kb. You should have no performance impact.


If that would be the thinking of every component I have installed on my site I would look at 1MB unnecessary load! And that IS heavy in most parts of the world for mobile connections. And my site is mainly used on mobiles in these parts.

That is weird. So I conclude CB does not use the default jQuery version that ships with Joomla?

I urge you guys to please apply some sanity when you make such decisions. There is a reason why Joomla ships already with jQuery: to prevent exactly that counter productive behaviour of third party developers what you are doing.

Please think again! Thanks.

CB 2.0

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
10 years 4 months ago #246538 by beat
CB's jQuery loads only on CB pages. And on those pages, Joomla's jQuery doesn't load (unless you have modules that use it). Thus it's not 1MB but still only 100kb ;-) And if your server is configured in a normal way, it's browser-cached, so loaded only once.

However, I fully understand your request.

Our previous decision was at a time when Joomla didn't have a jQuery at all, then we reconsidered the decision when Joomla added its own, but soon it was an old incompatible version, then some popular templates loaded their own versions, again incompatibility issues. It became at one point the #1 support issue, so we decided to implement deep non-conflicting mode to avoid any issues, and since then that support issue went completely away at a minor bandwidth cost.

We will re-discuss the question inside CB team when we move jQuery from the CB component to the new CBLib of CB 2.0, which will happen before CB 2.0 stable. The only way that I see that could happen is if CB has an efficient way to check if Joomla has a compatible jQuery version depending on Joomla's version (CB 2.0 doesn't run only on latest Joomla 3.x, so it's always less easy than at first glance).

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum