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

175
Vistas
Rendering an EJS templated page from Front-end Javascript....>

I have a Node / Express / EJS backend with the usual HTML / CSS . Javascript front end.

I obviously manage the page rendering from the backend through APIs but I have a Use Case where a front end page (User Settings) has a button on it to Reset the User password. Standard HTML on the page with:

<input class="submit__button" type="button" value="Submit Changes">

and then at the bottom of the HTML Page Im calling the JS file as you would:

<script src="/js/usrSettings.js"></script>

and in the .js file, Im trying to render an ejs template from the backend which has all the logic to reset a password by doing so:

// Redirect to the Reset Password Page when button clicked
const pwdChange = document.getElementById('submit_pwdChange');

pwdChange.addEventListener('click', function () {
    const pwdReset = ejs.render('pwdReset', { layout: './layouts/noLayout', title: 'Apotheosis - Reset Password' });
});

This doesnt work, Im not getting any error msgs either in the front end console Log, nor in the back end but it just doesnt do anything, doesnt render a page, doesnt crash, nothing.

I was wondering how one would go about calling an EJS template from the front end javascript to redirect to that html page?

Any suggestions greatly appreciated.

Cheers, M.

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