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

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started