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.
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.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.