$(document).ready() – How it is being executed?. Whether the cursor will be waiting in that piece of line in order to execute the code after DOM creation OR this method will be executed like event handler after the DOM has been created by the browser?
What if the image doesnt get downloaded but the $(document).ready() gets executed to read the that image’s src attribute to assign to some other local variable after the DOM construction?
It’s an event handler, and it doesn’t wait for everything to download. It only waits until the DOM has been constructed and is
readyto be transformed. From the docs:Code behind it is fairly simple, actually. It just waits for
document.bodyto be accessible (not null):From http://james.padolsey.com/jquery/#v=1.6.2&fn=jQuery.ready