Answers for "how to know if page is loaded using javascript"

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>
Posted by: Guest on April-13-2021
0

how to check if window is loaded javascript

function checkLoaded() {
  return document.readyState === "complete" || document.readyState === "interactive";
}
console.log(checkLoaded()) // true or false
Posted by: Guest on August-17-2021

Code answers related to "how to know if page is loaded using javascript"

Browse Popular Code Answers by Language