[TxMt] Prototype & Scriptaculus Bundle
thomas Aylott
thomas.42 at gmail.com
Fri Jul 21 21:49:51 UTC 2006
On Jul 21, 2006, at 4:47 PM, Andreas Wahlin wrote:
> If you use prototype, there's a modified version in there that
> adds .bind(this)
>
> *cough* slightly off topic. The .bind(this) just makes the this
> keyword accessibly in the function that you bind it to, right? Sort
> of like passing it in as an argument when you call the function.
>
> Andreas
.bind() replaces every use of "this" inside with a call to the object
you put in the argument. Like so:
function(){
alert(this.thinggy);
}.bind({thinggy: 'Howdy!!!'})
thomas Aylott—subtleGradient
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060721/3b627ff2/attachment.html>
More information about the textmate
mailing list