Re:Bling – the $ of jQuery without the jQuery
by tracker1 on Monday June 15, 2015 @07:55AM
(#9718757)
IIRC, there is a jQuery global object available.. you can assign it to a local variable inside in iife, which is the appropriate way to use jQuery when writing a module...
(function(window,$){
//module code goes here
}(this.self || this, jQuery));
In this way, you are keeping jQuery itself and your implicit scope assigned to localized variables.
If you are writing a modern module (not necessarily jQuery based), then following node/cjs conventions is probably best. If you use this convention with such a plugin, said module should probably return the jQuery object that has been modified, and extra care should be taken that all plugins are using compatible/same instance of jQuery.
If you are writing a modern module (not necessarily jQuery based), then following node/cjs conventions is probably best. If you use this convention with such a plugin, said module should probably return the jQuery object that has been modified, and extra care should be taken that all plugins are using compatible/same instance of jQuery.