We're talking about the same thing... The only difference is that I was referring to jquery's bind() for events as getting a new scope argument.
-- Sent from my Palm Prē Daniel Friesen wrote: Rick Waldron wrote: > Available, as in the "scope" argument is being retrofitted to an > existing function, and ONLY to that function. > > I don't get what you are talking about a fn.bind() implementation in > jQuery, or what you mean by available in just one function though. > > > Read ES5. > > function.prototype.bind() I already read ES5, I use portions of ES5 in a number of js server-based projects already. However I don't get "ONLY" one function, since the whole point of .bind() is to bind a `this` onto ONE function with one call. It's not bind otherwise. So I don't see any limitation. Unless you are under the misinterpretation that after you have called .bind() on one function you have modified that function and bound it's `this`. .bind() doesn't modify the function, it returns a new one. From ES5 15.3.4.5 Function.prototype.bind > The bind method takes one or more arguments, thisArg and (optionally) > arg1, arg2, etc, and returns a *new* > function object by performing the following steps: So this is valid ES5 code. "use strict"; var a = function() { alert(this); }; var a1 = a.bind("a"); var a2 = a.bind("b"); a(); // Alerts undefined a1(); // Alerts "a" a2(); // Alerts "b" > On Mon, Dec 28, 2009 at 7:43 PM, Daniel Friesen > <nadir.seen.f...@gmail.com <mailto:nadir.seen.f...@gmail.com>> wrote: > > I made a post about how confusing people may find the name bind some > time ago. Suggested renaming bind to something like event, and keeping > bind as an alias of course. That was rejected. > > I don't get what you are talking about a fn.bind() implementation in > jQuery, or what you mean by available in just one function though. > > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) > [http://daniel.friesen.name] > > Rick Waldron wrote: > > John, > > > > While I'm glad to see a scope arg available, i still think this is > > negligent to the future of jQuery and ES standards. I really think a > > fn.bind() implementation would ideal (since it would be jQuery-wide > > and not just available in one function), but as I've noted in > the past > > and is exampled here, beginners may find this syntax a bit boggling: > > > > $(foo).bind('event', fn.bind(bar) ); > > > > Rick > ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en. -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.