Answers for "how to wait until page is loaded in javascript"

8

js wait for page to load

document.addEventListener("DOMContentLoaded", function(event) { 
  //do work
});
Posted by: Guest on May-19-2020
1

how to tell the javascript to wait until the site loads in the html

use the 'defer' keyword
<script type="text/javascript" src="index.js" defer></script>
Posted by: Guest on August-10-2021

Code answers related to "how to wait until page is loaded in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language