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.377 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started