我有一个 Jquery 函数,它读取 FilesList 并在 IMG html 对象中显示图像。
function load_images(files) {
for (var i = 0; i < files.length; i++) {
// Validate the image type
if(validate_file(files[i])) {
var reader = new FileReader();
reader.onload = function(e) {
$(".upload_thumbnails").append(render_thumb(e.target.result, i)); // Return a string with the img object
};
}
reader.readAsDataURL(f);
}
}
但我的图像不是按文件列表的顺序附加的。fileList(var 文件)由多输入文件 html 对象实现。
你有什么主意吗 ?