jquery - Multiple $(document).ready functions -


this question has answer here:

if have multiple $(document).ready(...) functions, overwrite each other? sake of argument, pretend proper coding thrown out door on one.

say have $(document).ready(function() {...}); in site's script file. use third party plugin uses $(document).ready(function() {...});. overwrite created function or jquery "queue" these functions run when document ready?

no, not override each other. each function executed.

you of course check yourself: http://jsfiddle.net/6jggt/

or understand jquery code itself:

line 255 ready function jquery.bindready(); called among other things initialises readylist object on line 429 readylist = jquery._deferred();

and once it's deferred object function passed in appended readylist.done( fn ); , can see in done method on line 41 element added array callbacks.push( elem ); each 1 saved separately...


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -