$( ‘#pic‘ ).change(function () {
???????var file = $(this)[0].files[0];
???????var reader = new FileReader();
???????reader.readAsDataURL(file);
???????reader.onload=function () {
???????????$(‘#mypic‘)[0].src = this.result;
???????}
???})
//一个简单的js图片预览功能,需要有个id 。 2018年10月29日。晚。
JQ实现上传图片预览。当然能够采用插件就用插件。
原文地址:https://www.cnblogs.com/woshitgy/p/9874047.html