Well, and agreeably what I wrote seems a bit odd, however there are many
cases when making "this" available to the anonomyous function is handy.
What I have found, is when I bind "this", then you lose scope of the
containing context. Take for example:
var x = 1;
vary array = [1,2,3,4];
array.each(function(num) {
if (num == x) { // x is out of scope, x is undefined
// do something, involving "this"
}.bind(this));
So, to bind this, and pass the value of x, the argument order seems to be
backwards.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/YNwJ4O3JYk8J.
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.