html5Preloader.js icon indicating copy to clipboard operation
html5Preloader.js copied to clipboard

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

Open connected opened this issue 11 years ago • 1 comments

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.

connected avatar Jan 30 '14 18:01 connected

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.

jussi-kalliokoski avatar Feb 17 '14 10:02 jussi-kalliokoski