Although both document ready event and document on load event is used to execute task. When sheet is loaded there is fine difference between them. Document ready method which is not a method, but an occasion is fired. When the document is ready all the elements of document is available. However, not of necessity all contents, images and video. On the other hand built-in document event is fired hence the HTML document is completely loaded including document and all its content. For the reason that you may see that scripting code defined in the document. Ready () executes before code defined on documrnt. Onload () event. Particularly if loading of images get long time.
What is event bubbling?
The idea of event bubbling was introduced to deal with situations where a single event such as a mouse click may be handled with two or extra event handlers clear at different levels of the Document Object Model (DOM) chain of command. But this is the case the event bubbling process starts by executing the event handler clear for individual elements at the lowest level. Since there the event bubbles up to the containing basics, then up to even higher-level elements. Finally the event ends up being handled at the highest level in the DOM chain of command the document element itself.
Home / Computer Languages
/ Learn Difference between document load event and document ready event and what is event bubbling For Beginners
Blogger Comment
Facebook Comment