Jörn Zaefferer wrote:
Adding to the local scope could overwrite a prototype method with the event handler. Imagine a handler-plugin:

$.fn.handler = function() { ... };


Now adding to this could actually have a bad effect:

$.fn.plugin = function() {
    this.handler = function() {
        ...
    }
    $("...").bind("...", handler);
};

Because you are overwriting another method. $("...").plugin().handler() wouldn't yield the expected result.

I also pointed that out in the blog comments, but you explained it a bit better than I did. I think if this occurs, it would give you a reaaaaaaally hard time debugging.


--Klaus

Reply via email to