In Magento environment, prototype rules. In order to play with jQuery, we need to:
- load jQuery before prototype
- check if jQuery is already loaded before loading it (by some other module, or the webdesigner)
- prevent conflicts with prototype using jQuery.noConflict();
Complementary to that, I prefer to avoid packaging again and again the JavaScript libraries, so the solution would be to load external_js; two major benefits:
- Module easier to debug
- Gain loading speed by using cached files (for instance, using cdn), the more developers use this practice, the better for us all it will be.
How to mix all these requirements?