The crucial point is, to try and do things just a tiny bit harder than you can manage right this moment.
Inside a function A, THIS always points to the scope outside the function A. Unless, it gets NEWed. Then THIS would point to the object NEWed out, all the THISes inside of that function A, inside of the function B that’s inside of the function A, and inside of the function C that’s inside of the function B that’s inside of the function A… Since the this inside of function A is the object, and all the functions inside of function A points to their outer scope, which is the THIS inside of function A.
Coffee did me in this afternoon.
This strange behaviour with console is worth paying attention to: it updates the object when you expand it. Say we have:
$('button').bind('click', fn); $('button').on('click', fn);
$('button').live('click', fn); $(document.body).on('click', 'button', fn);