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

83
Visualizações
EJS not showing only some variables

I have this ejs template:

<h1 id="city-name"><%= title %></h1>
<h5 id="weather-description"><%= description %></h5><br>
<i class="bi bi-thermometer-half"></i><p id="temperature"><=% temperature %></p><br>
<i class="bi bi-wind"></i><p id="wind"><=% wind %></p><br>
<i class="bi bi-moisture"></i><p id="humidity"><=% humidity %></p>

and this is my js:

jsonObj = res.data;
desc = jsonObj.weather[0].description;
temp = JSON.stringify(jsonObj.main.temp);
wind = JSON.stringify(jsonObj.wind.speed);
hum = JSON.stringify(jsonObj.main.humidity);
console.log(wind);
console.log(temp);
console.log(hum);
response.render('city_template.ejs', {title : nameCapitalised, description : desc, temperature : temp, wind : wind, humidity : hum});

but in the template it shows only the title and the description, not the other variables, in console it shows wind, temp and hum, what's wrong?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Some of your tags are incorrect.

For example, <=% temperature %> should be <%= temperature %>

about 4 years ago · Juan Pablo Isaza Relatório
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