在我的页面上运行后续脚本之前,我有许多测试条件和文件要加载。有没有办法在我的所有文件加载后触发回调?
这篇文章提出了以下建议,并传达了我的意图,但实际上并没有起作用。complete 中的函数在 1.js 或 2.js 完成加载之前触发。
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
}
]);