Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
why Ejs not being recognized by vscode

I have searching for solutions but nothing working. I installed ejs extention on vs code and also dependency. added *ejs and html in setting and tried several solution on StackOverFlow. The answer should come as Its a Weekend or Weekday but <%KindOfDay%> EJS not working.

/view/list.ejs code is:

<body>
    <h1>Its a <%KindOfDay%> </h1>
</body>

and app.js code is:

const express = require("express");
const bodyParser = require("body-parser");


const app = express();

app.set('views', path(__dirname, 'views'));
app.set('view engine', 'ejs');


app.get("/", (req, res) => {

    var today = new Date();
    var currentDate = today.getDate();
    var day = "";

    if (currentDate == 6 || currentDate == 0) {
        day = "Weekend";
    } else {
        day = "Weekday";
    }

    res.render("list", { KindOfDay: day });
console.log(day);
});

app.listen(3000, () => {
    console.log("Server Running");
})

I am providing screenshots and marked in red.

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are wrong tag to display an output. To display output write like this

<%= KindOfDay %>

The one you are using is 'Scriptlet' tag, for control-flow, no output. It is used with loops and if else statements etc.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda