I am using jQuery's getScript()
to load separate javascript files. The files seem to load fine (I know this as when I put an incorrect URL, it throws an error - no error with the correct URL).
However, the done()
function does not seem to work. The console does not log 'done', nor do any of the functions get called.
(function($) {
$.when(
$.getScript( templateUrl + "/assets/js/variables.js" ),
$.getScript( templateUrl + "/assets/js/functions.js" ),
$.getScript( templateUrl + "/assets/js/events.js" ),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function(){
console.log("done");
swapBackgroundImgs();
singleLarge();
bindFlexorder();
bindSvgeezy();
bindPlaceholder();
preloadImages();
});
})( jQuery );