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

171
Visualizações
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 à 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