Is it possible to report all the observers of the 'ready' events. I have a page where something is happening twice, and i'm trying to chase it back to the source.
Asked
Active
Viewed 103 times
0
-
possible duplicate: http://stackoverflow.com/questions/743876/list-all-javascript-events-wired-up-on-a-page-using-jquery – marcgg May 20 '10 at 10:06
-
@marcgg - This is an entirely different question, the answers to the one marked as duplicate don't apply at all...it's a very special case in jQuery, not the general one the other question's asking. – Nick Craver May 20 '10 at 10:17
1 Answers
0
Unfortunately you can't do this after it's executed, as it's a special event handler, which that "duplicate" question doesn't really cover.
$(document).ready(func)
(or $(func)
) or stores the functions you want to call in readyList
(internal array). Unfortunately for your situation, but good for performance/garbage collection, this list is nulled out after it runs, so you can't get the list you're looking for.
You can see how this happens in jQuery core here.
Your best bet would be console.log()
in a few functions /files to see if you get any duplicates I'd say.

Nick Craver
- 623,446
- 136
- 1,297
- 1,155
-
in theory I could add code to my copy of core and log the contents of readylist.... – Mesh May 20 '10 at 11:40
-
@Adrian - That's another option, I'd suggest adding it before line 242 here: http://github.com/jquery/jquery/blob/master/src/core.js#L247 – Nick Craver May 20 '10 at 11:54