Roy Tang

Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.

Blog Notes Photos Links Archives About

I’m trying to trace a slowdown on load of a web page in our application and there’s a ton of JavaScript to go through so I’d rather not process them individually.

I’m trying to see if there’s a way to list out all the event handlers added to $(document).ready() so that I would just look through those handlers to see what might be causing the problem.

Is there a way to do this?


I tried the solution here: but it didnt include the ready handlers apparently

I was able to do this by overriding jquery’s ready function itself so that I could store references to the handlers, i.e.

var readyList = [];
var origReady = jQuery.fn.ready;
jQuery.fn.ready = function() {
  if ((arguments.length) && (arguments.length > 0) 
    && (typeof arguments[0] === 'function')) {
  origReady.apply(this, arguments);