check if page is loading javascript code example
Example 1: how to check if page is loaded in javascript
<body onload="onload()">
<div>
<p>TEXT</p>
</div>
</body>
<script>
function onload(){
console.log("Window Has Been Loaded!")
}
</script>
Example 2: if page is loading then show loader in js
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>