Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Auto check for existing jQuery 20 Jan 2013 13:04 #6485

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Dear Cooks and head chef,

I think its quite important to load only assets that aren't already loaded into joomla and therefore, I wonder, could we add j-cook.pro/forum/35-jquery/6484-avoid-co...y-only-if-not-loaded this into components by default?

It's just a short script to check the head before adding the jQuery library to a component.

Anyway, just a suggestion. To achieve this in your existing COOK components, follow the linked post above.

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Last edit: by JoomGuy.

Re: Auto check for existing jQuery 25 Jan 2013 13:57 #6507

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I've read it and I do not real answer for that. The code you propose works only if jquery is loaded through an url or file wich contains 'jquery'.


I take note to include a param wich allow or not jquery loading. I think it is the most easy and stable.
Another way is to call it in JS, checking if the jQuery var is defined (once all the scripts have been loaded).
Coding is now a piece of cake

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

Re: Auto check for existing jQuery 25 Jan 2013 14:13 #6508

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Yes, good point monsieur!

I guess it's not 100% safe way to check it although, 99.9 percent of JS bundled in components would use 'jquery' in the path/filename.

G
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

  • Page:
  • 1
Time to create page: 0.063 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started