Is there any difference between the following code?
$(\'#whatever\').on(\'click\', function() {
/* your code here */
});
and
They appear to be the same... Documentation from the click() function:
This method is a shortcut for .bind('click', handler)
Documentation from the on() function:
As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off().