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

Files with the same name prevent any events from being triggered. #33

Open
connected opened this issue Jan 30, 2014 · 1 comment
Open

Comments

@connected
Copy link

If you have something like this:

var myLoader = html5Preloader();

myLoader.on('finish', function(){
    alert('LOADED');
});

myLoader.on('error', function(){
    alert('ERROR');
});

myLoader.addFiles(
    'images/1.jpg', 
    'images/1.jpg', 
    'images/2.jpg'
);

no event is triggered. But if you add invalid file or remove duplicate, everything works fine.

@jussi-kalliokoski
Copy link
Owner

Hmm, yes... This is due to the URLs being handled as IDs if the ID is not specified, so you have two files with the same ID, and to the preloader it looks like only two files were loaded and three were expected. Trying to do this should probably throw an error instead.

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