I am using yepnope.js as a downloaded resource. I want to execute code in the JS module only when all dependencies for this module are loaded. I do not want to load downloaded JS dependencies.
Suppose I have dependencies of D1.js and D2.js. I tried
yepnope({ load: ['D1.js', 'D2.js], complete: function() { //execute my code here } });
This works, but resources are loaded every time, even if they have already been loaded before.
If I run a few tests:
yepnope([{ test: $().d1, nope: 'D1.js' }, { test: $().d2, nope: 'D2.js' }]);
It is unclear where to put the fully completed function - the one that starts after loading all resources.
Can this be done with yepnope, or do I need to use another component?
Thanks.
source share