Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete not called if nothing loaded #236

Open
SonOfLilit opened this issue May 8, 2016 · 1 comment
Open

complete not called if nothing loaded #236

SonOfLilit opened this issue May 8, 2016 · 1 comment

Comments

@SonOfLilit
Copy link

Despite the docs stating that:

When does the complete callback fire?

In versions of yepnope prior to 1.5 this could vary from time to time, but now the complete callback is always called regardless of what happens when all (or even when nothing loads) the resources are loaded.

In fact what happens in at least 1.5.3 and 1.5.4 is that this code prints only "1":

var exists = 'https://cdnjs.cloudflare.com/ajax/libs/es6-promise/3.2.1/es6-promise.min.js';
var noSuchFile = 'https://example.com/no-such-file.js';
yepnope({test: true, yep: [exists], nope: [], complete: function(){console.log('1');}})
yepnope({test: true, yep: [], nope: [exists], complete: function(){console.log('2');}})
yepnope({test: true, yep: [], nope: [noSuchFile], complete: function(){console.log('3');}})
@icyield
Copy link

icyield commented Jul 25, 2020

Use,
yepnope({test: true, nope: [exists], complete: function(){console.log('2');}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants