我无法显示来自文件 URL 的照片。[Object HTML IMAGE ELEMENT]
即使我认为我将此元素指向图像源,我也只会进入页面。
//database query results...
for(var i = 0; i < len; i++){
theID = results.rows.item(i).id;
console.log(theID);
theName = results.rows.item(i).username;
htmlStr += theName;
console.log(theName);
thePhoto = results.rows.item(i).imagepath;
console.log(thePhoto);
var imageHold= new Image();
imageHold.src = thePhoto;
console.log("this is the src:"+imageHold.src);//THIS IS GIVING ME THE PATH
var userDiv = document.createElement("div");//Create the div
userDiv.innerHTML=htmlStr+imageHold;//IS THE PROBLEM WHAT I AM DOING HERE?
document.getElementById('showUsers').appendChild(userDiv);//append it to the document
userDiv.style.display = 'block';
}