I am having problem with binding a jQuery event to gmail 'body'
$('body').on('click', function(event) {
console.log("Entered function");
});
Visit IMDB.com (for example) and in Google Chrome developer console paste in the above code. When you click on the page, you can see "Entered function" printed on the console.
But when I try the same with gmail, I get the following message:
TypeError: Object #<HTMLBodyElement> has no method 'on'
What is going on with gmail, and how do I work around this?
EDIT :-
Non JQuery Version:
document.addEventListener("click", function() {
console.log("Entered function");
}, false);
Like the commenters have pointed out, jQuery is not loaded with Gmail, here is a non jQuery version, it works when you click on gmail, but when you click on a link (open an email with some links in them) it doesn't work anymore.