Answers for "on script load javascript"

2

on load javascript

window.addEventListener('load', (event) => {
  console.log('page is fully loaded');
});
Posted by: Guest on April-08-2020
2

javascript on script loaded

function loadScript( url, callback ) {
  var script = document.createElement( "script" )
  	  script.type = "text/javascript";
 	  script.onload = function() {
     	callback()
      };
}
// call the function...
loadScript("js/myscript.js", function() {
  alert('script ready!'); 
});
Posted by: Guest on March-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language