Invisible image while using html

Invisible image while using html

  

Hello all,

I'm trying to display an image using html. I used the code below in the expression.


SyntaxEditor Code Snippet

"<img id='myImg' src='/CloneOfMultiFileUpload_Demo/xls.PNG' alt='The Pulpit Rock' width='304' height='228'>
 

But the image is not visible on my web-page. It shows a cross mark.

Solution

Looking at the URL I assume you have added the image as a resource rather than an image (an image URL would look like /CloneOfMultiFileUpload_Demo/img/xls.PNG). When uploading a resorce you need to select the Deploy Option to Deploy to target folder. eg

Solution

That was perfect John. Thanks for the quick resolution.

John Williams wrote:

Looking at the URL I assume you have added the image as a resource rather than an image (an image URL would look like /CloneOfMultiFileUpload_Demo/img/xls.PNG). When uploading a resorce you need to select the Deploy Option to Deploy to target folder. eg


Hello John,

This worked well for me. Meanwhile I have another question. I'm trying to display images using this method in the table records. But only the first row shows the image and the rest shows a cross mark. 

The modified js:

SyntaxEditor Code Snippet

"<html>
   <body>
     <img id='img' src='#'>
 <script>
        var i = '"+Var1+"';
        if(i=1)
        {
         document.getElementById('img').src = '/CloneOfMultiFileUpload_Demo/pdf.PNG';
        } 
        else 
        {
           document.getElementById('img').src = '/CloneOfMultiFileUpload_Demo/xls.PNG'
        };

    </script>

  </body>
 </html>"

 I have attached the screenshot for reference.

Thanks,

Samuel Stephen