News for hackers. Stuff that matters.
Re:Why I still prefer Prototype to jQuery by axod on Tuesday January 13, 2009 @05:26AM (#431883)
>> "The behavior I just described makes `this` is almost useless in Javascript closures"

Hmm??

e.onmouseover = function(c) {return function() { c.dosomething()}}(this);

Then in the dosomething function, "this" references what you expect...

I don't see why you need a library to construct a simple closure.

Re:Why I still prefer Prototype to jQuery by fh on Tuesday January 13, 2009 @07:50AM (#431968)
Note how you haven't used the keyword `this` inside the closure. What you've written is functionally equivalent to the technique I described, assigning the `this` object to a temporary variable. The only difference is that you bind it with a lambda instead of a `var`.
Re:Why I still prefer Prototype to jQuery by axod on Tuesday January 13, 2009 @09:01AM (#432023)
I don't use the keyword this inside the closure, but inside the function dosomething() I can happily use "this".