Hi, > Otherwise, in some of my more intense > methods, I have function calls inside function calls, and have to > do .bind(this) at the end of each curly brace in these nested > functions and that ends up looking extremely confusing (and ugly).
I'd be interested, could you post a short excerpt showing that? That sounds like the kind of situation where I might do the `var blah = this` thing, or more likely just pass a parameter, but I can't quite envision what you're describing. I don't find myself in situations like that very often, mostly I find needing to do this just on event handlers. -- T.J. On Apr 10, 6:25 am, patrick <[email protected]> wrote: > Thanks for the reply T.J., > > Hmm.. Yeah it just seems like there's no way to win in this case. On > one hand, I have to resort to redundancy of setting var blah = this; > inside my class methods-- Otherwise, in some of my more intense > methods, I have function calls inside function calls, and have to > do .bind(this) at the end of each curly brace in these nested > functions and that ends up looking extremely confusing (and ugly). So > in those cases I am just doing the var blah = this, so I can just > refer to that variable inside the functions and not have to worry > about binding... > > I remember reading somewhere once that jQuery did away with the use of > 'this' for this very reason (confusing and limiting)... > > -patrick -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
