情景:当图片存储在数据库中,上传后立即回显
var url=path+"/user/img?photopath="+photopath;
document.getElementById('photo').src=url;
js原生方法:document.getElementById("photo").src = "xxxx.jpg";
Jquery方法:$("#photo").attr("src","xxxx.jpg");
情景:当图片存储在数据库中,上传后立即回显
var url=path+"/user/img?photopath="+photopath;
document.getElementById('photo').src=url;
js原生方法:document.getElementById("photo").src = "xxxx.jpg";
Jquery方法:$("#photo").attr("src","xxxx.jpg");