Answers for "how to include script file in javascript"

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
0

how to include script file in javascript

import('your-file-name.js')
//this only works for javascript files
//and with bugs or half bugs it won't work
Posted by: Guest on March-17-2022

Code answers related to "how to include script file in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language