Answers for "javascript run onload"

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
1

load js

// Log a message when the page is fully loaded:

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

run on load js

function codeAddress() {
            alert('ok');
        }
window.onload = codeAddress;
Posted by: Guest on June-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language