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.
Object.prototype.toString.call()?
This seems to be a standardised way to tell the type of a javascript object. Why?
A little tweak with Chrome Console
This strange behaviour with console is worth paying attention to: it updates the object when you expand it. Say we have:
jQuery: Difference between bind, live and on
Equivalent:
$('button').bind('click', fn); $('button').on('click', fn);
Equivalent:
$('button').live('click', fn); $(document.body).on('click', 'button', fn);
Facebook: Share, Like, Comment
This is how to utilise the Facebook JavaScript SDK to add Share, Like and Comment for your site:
MAMP: 403 Forbidden – You don’t have permission to access x on this server
If you see this:
The order of the events triggered will be in the order they’re added. So when the order of two events makes a difference, and they’re in separate files, pay extra attention to which one gets load first. Especially when the page loads extra slow.