Primitive events logger


/ Published in: jQuery
Save to your folder(s)

Quite useful snippet to log all events triggering occuring in your app. Because it uses event.global array, it logs custom events as well as native ones
For developpement use only, disable it before migrating to production environement.


Copy this code and paste it in your HTML
  1. for(var eventName in $.event.global) {
  2. $("*").bind(eventName, function(event) {
  3. console.log(
  4. event.type+": "+
  5. event.target.nodeName+") "+
  6. Array.prototype.slice.call(arguments, 1).join(", "));
  7. });
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.