Skip to content

Instantly share code, notes, and snippets.

@calvinchoy
Last active April 4, 2020 09:00
Show Gist options
  • Save calvinchoy/e1fac22b66208a9c41db to your computer and use it in GitHub Desktop.
Save calvinchoy/e1fac22b66208a9c41db to your computer and use it in GitHub Desktop.
JS - Loading multiple js files async #jquery
$.when(
$.getScript( "/mypath/myscript1.js" ),
$.getScript( "/mypath/myscript2.js" ),
$.getScript( "/mypath/myscript3.js" ),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function(){
//place your code here, the scripts are all loaded
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment