removeChild() works as intended but gives an error? localStorage. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Theres also the readystatechange event that triggers when the state changes, so we can print all these states like this: The readystatechange event is an alternative mechanics of tracking the document loading state, it appeared long ago. Loop (for each) over an array in JavaScript. How to Draw a Semi-Circle using HTML and CSS ? lazy load the big library. The cross-browser way to do it in pure JavaScript is simply to test document.readyState: You can select from either an loading, interactive or complete states. Summary: in this tutorial, you will learn about the events that are related to the page load including DOMContentLoaded, load, beforeunload, and unload. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Visit SpeedLab. When the browser processes an HTML-document and comes across a