Reputation: 153
i am working with mobilefirst project.
I am facing an issue of not able to load an image in javascript. My image is placed inside a images folder. when i check the console is added inside the div and tool tip over that srctells Could not load the image.
jQuery('#placeher').show();
// var table = $('#mydemo1');
for (var i = 0; i < result.length; i++)
{
doc1=result[i];
if(doc1.PHOTO == "")
{
var elem = document.createElement("img");
elem.setAttribute("src","../common/images/Icon-60.png");
elem.setAttribute("height", "60");
elem.setAttribute("width", "60");
document.getElementById("placeher").appendChild(elem);
}
}
Upvotes: 0
Views: 51
Reputation: 44516
The correct path to use for the images folder is simply images/<image file name>
. For example: <img src="images/thumbnail.png"/>
.
Upvotes: 1