Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript on script loaded

function loadScript( url, callback ) {
  var script = document.createElement( "script" )
  	  script.type = "text/javascript";
      script.src = url;
 	  script.onload = function() {
     	callback()
      };
     document.head.appendChild(script); 
}
// call the function...
loadScript("js/myscript.js", function() {
  alert('script ready!'); 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #script #loaded
ADD COMMENT
Topic
Name
7+8 =