Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js load js file

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!'); 
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: scrollbar automatically scroll down as new divs are added reactjs 
Javascript :: react native text input select all text on focus 
Javascript :: drupal 8 check if current page is node 
Javascript :: node js cron example 
Javascript :: url in js 
Javascript :: disable button click jquery 
Javascript :: convert moment info to dd mmm yyyy 
Javascript :: __dirname is not defined 
Javascript :: vue js reload page 
Javascript :: gulp sequential tasks 
Javascript :: document print from html javascript 
Javascript :: javascript function argument type 
Javascript :: node mssql 
Javascript :: how to fix Composer could not find a composer.json file in Z:xampp 7312htdocsproject_karakter-master 
Javascript :: js add to array if not exists 
Javascript :: react native dimensions window vs screen 
Javascript :: get first day of the week of a given date javascript js 
Javascript :: javascript countdown timer 
Javascript :: async in useeffect 
Javascript :: how to change css style on click 
Javascript :: get url without parameters javascript 
Javascript :: jquery on click fade out element 
Javascript :: sort array without changing original array 
Javascript :: find is not a function javascript 
Javascript :: how to create a package.json file in npm 
Javascript :: compare two dates using moment 
Javascript :: javascript get now date yyyy-mm-dd 
Javascript :: vue js countdown timer 
Javascript :: hot reload problem react 17 
Javascript :: convert decimal to binary javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =