We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Conflicts between add-on javascript files (or, how to make add-ons play nicely when sharing js files?)

Development and Programming

Brett DeWoody's avatar
Brett DeWoody
140 posts
15 years ago
Brett DeWoody's avatar Brett DeWoody

While developing one of my add-ons for EE2 I’ve been having issues with javascript conflicts. In short, if I add two of my custom Flickr fieldtypes they both load the same javascript files and this causes a js conflict and results in the fieldtype not working.

I’ve seen this happen in other CMSs too (namely Joomla). Each add-on/extension/module loads its own javascript files, unaware of the files other add-ons have loaded. This often results in redundant file loads and conflicts. And as more and more add-ons are developed for EE2 I see this only getting worse.

Is there a trick to preventing this? If not, I’ve been bouncing around a few ideas…

My first thought is to develop a “developer’s add-on” which gives other developers access to common javascript libraries - things like fancybox, the jquery form validator plugin, etc. Developers could pull these files from a common source using an API that checks to see if the file has already been loaded from another add-on.

Is there any interest in this? If so, which additional libraries would you like to see included? Anything from javascript files, jquery plugins to php wrapper classes for common APIs could be added.

       
Cue's avatar
Cue
98 posts
15 years ago
Cue's avatar Cue

The developer’s add-on sounds like a treat. I think it will also solve issues where add-ons that require a specific platform as such can use this form of functionality within their addon or perhaps developers have a one-click access to obtain these additional libraries to help support their works.

I know this is slightly off-topic, but I have been looking to develop ‘extensions’ and ‘accessories’ of my own and was wondering if you know of any good resources, tutorials perhaps that can lead me in the right direction? I have a good understanding of 1.6 but the migration to 2.0 has put me to sleep hehe.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.