yepnope / modernizr.load全局完整回调?

时间:2013-04-02 14:40:22

标签: javascript modernizr assets yepnope

一旦所有文件加载,是否可以触发全局完整回调?例如:

yepnope(['file1.js', 'file2.js'])

....一些HTML ......

<script>
    yepnope({complete: function() { console.log('This is getting called before the above files finish loading') });
</script>

1 个答案:

答案 0 :(得分:1)

您是否尝试过以下内容?

Modernizr.load([

  {
  load : ["file1.js", "file2.js"],
  complete : function()
  {
  // do some stuff
  }
  } // can repeat this block as required

]);
祝你好运!