Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
img tag not displaying images when using with ejs

I'm working with express, ejs and mongoose . i have list of products in mongoDB and i want to display images of products which is store in my local storage. i used express.static method to access images. my images named like this SAMSUNG Galaxy M33 5G (Emarld Brown, 128 GB) (6 GB RAM) , i saved their name in an array ( like object ) called category. my code is following

    <% for( list of category){ %> 
        <ul>
            <img src="/<%=list.name%>.jpeg" alt="<%=list.name %>">
            <li><%= list.name %> </li>
        </ul>
     <% } %>

in this case no image is displayed but when i removed brackets () from the name of image ( like this SAMSUNG Galaxy M33 5G Emarld Brown, 128 GB 6 GB RAM ) it start working like wonder but i have so many images and i cant change name of all images please help me to solve this problem

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda