//显示小图片
var reader=new FileReader();
reader.onload = function ( event ) {
var htmlStr = null;
var src = null;
if (isImage(file)){
src = event.target.result;
htmlStr = "<img src='"+src+"'>";
}
$("#id").append(htmlStr);
};
reader.readAsDataURL(file);
转载于:https://www.cnblogs.com/zhuzhiq/p/5662540.html