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() { ... },
= 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
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() { ... }
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
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
___
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