36
Views
3
Comments
Solved
Invisible image while using html
Question

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.

2021-04-21 23-06-46
Jeanene Williams
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

UserImage.jpg
Samuel Stephen

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

Screenshot (6).png
UserImage.jpg
Samuel Stephen

That was perfect John. Thanks for the quick resolution.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.