Answers for "check if js is loaded"

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 "check if js is loaded"

Browse Popular Code Answers by Language