Posted By

mandawan on 09/03/12


Tagged

jquery events logger


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

BrockSamsom
rygiel
pibot77


Primitive events logger


 / Published in: jQuery
 

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.

  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  

You need to login to post a comment.