On Tue, Mar 13, 2012 at 1:00 PM, Russell Leggett
<[email protected]>wrote:

>
>> Can you answer the 'cost' side of the BTF issue? That is if BTF was
>> really easy, how many times would we have to opt-out so we can use the
>> default value of "this"? My guess: you will need a lot zeros in place
>> of X  in 0.0X% ;-)
>>
>> Sometimes the 'this' is not needed at all; does it ever matter that it
>> is set to the lexical this?
>>
>>
> There is a really big use case here that I worry about with BTF: jQuery
> event handlers
>
> For whatever reason, the jQuery guys decided that it would be awesome if
> inside the handler, 'this' was bound
> to the dom element that the event handler was attached to.
>

Yes! Much like the DOM:

http://jsfiddle.net/rwaldron/KUdYE/

Rick


>
>
> $('#foo').bind('click', function() {
>   alert($(this).text());
> });
>
>
> I think you'll find that pattern all over the place for those using jQuery.
>
> - Russ
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to