How do DOM readiness and the window load event differ in jQuery?
Instruction: Compare $(handler) with $(window).on("load", handler), including late registration and the removed load-event shorthand.
Context: This question aims to assess the candidate's understanding of jQuery events and their appropriate application in web development.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Use $(handler) for work that requires the DOM, such as attaching handlers to existing elements...