Answers for "execute js file in js"

23

load js file

<script type="text/javascript" src="path-to-javascript-file.js"></script>
Posted by: Guest on March-08-2020
2

javascript include js file

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

Browse Popular Code Answers by Language