On 29-Jul-09, at 7:07 AM, Aaron Zeckoski wrote:
I am trying to figure out the best practice for JS namespacing and
there is a ton of conflicting information out there.
I have sorta settled on one of these:
1) From some of the websites on namespacing
var AZ = function($) {
...
}(jQuery);
2) From looking at the Fluid stuff as an example
var AZ = AZ || {};
(function($){
...
)}(jQuery);
Aaron, one advantage of option #2 over option #1 is that it doesn't
tromp on anything that might already exist in the namespace - it
simply adds to it. This is part of why we use this technique in
Infusion, because we have multiple files that add things to the fluid
namespace.
--
Anastasia Cheetham [email protected]
Software Designer, Fluid Project http://fluidproject.org
Adaptive Technology Resource Centre / University of Toronto
_______________________________________________________
fluid-work mailing list - [email protected]
To unsubscribe, change settings or access archives,
see http://fluidproject.org/mailman/listinfo/fluid-work