I have a number of test conditions and files to load before I run the follow up scripts on my page. Is there a way to fire a callback after ALL my files are loaded?
The following is suggested by this post and communicates my intent but does not actually work. The function in the complete is firing before 1.js or 2.js has finished loading.
Modernizr.load([
{
test: App.isSmallScreen,
yep: '1.js',
nope: '2.js'
},
{
test: App.isTouch,
yep: '3.js'
},
{
test: Modernizer.csstransitions,
nope:4.js
},
{
complete: animationInit
}
]);