david
david

Reputation: 153

Image from images folder is not loading in mobilefirst

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

Answers (1)

Idan Adar
Idan Adar

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

Related Questions