Reputation: 6846
I've been asked to help debug a pretty tattered hunk of jQuery. I'm finding the the block contains several occurrences of document.ready -- often different variations of "ready" syntax.
Anyway, besides be horribly disorganized -- is there a code execution impact when several of these events exist on the same page? A negative hit to performance? Or perhaps risk of race conditions or the like?
Upvotes: 1
Views: 104
Reputation: 790
Each document ready block will be run sequentially as shown here: http://jsfiddle.net/fVM4x/
Also check out the documentation here: http://api.jquery.com/ready/
Upvotes: 0
Reputation: 38300
each .ready adds a handler to the list of handlers for the "ready" event. There is no race condition; they should be called in the order that they are added.
Upvotes: 1