Re: [jQuery] Advantages of adding functions to jQuery

2007-03-15 Thread Jörn Zaefferer
Daniel MacDonald schrieb: I believe I got it, using: jQuery.log = { error : function() { ... }, warning : function() { ... }, debug : function() { ... }, }; as opposed to: var log = { error : function() { ... }, warning : function() { ... }, debug : function() { ... },

[jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Daniel MacDonald
= function() { ... } log.prototype.debug = function() { ... } It seems the former opens up the door to unintended closures. What are the benefits of doing it this way as opposed to the traditional non-jQuery way? -- View this message in context: http://www.nabble.com/Advantages-of-adding

Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Michael Geary
I'm having trouble seeing the advantage of adding static functions to jQuery as in: jQuery.log = { error : function() { ... }, warning : function() { ... }, debug : function() { ... }, }; as opposed to: function log() { ... } log.prototype.error = function() { ... }

Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Jörn Zaefferer
Daniel MacDonald schrieb: It seems the former opens up the door to unintended closures. What are the benefits of doing it this way as opposed to the traditional non-jQuery way? Thats it! By putting everything into a single global object, there isn't the chance of colliding with other

Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Erik Beeson
Like pseudo packages/namespaces. --Erik On 3/14/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Daniel MacDonald schrieb: It seems the former opens up the door to unintended closures. What are the benefits of doing it this way as opposed to the traditional non-jQuery way? Thats it! By

Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Daniel MacDonald
___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Advantages-of-adding-functions-to-jQuery-tf3404801.html#a9486114 Sent from the JQuery mailing list archive at Nabble.com