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

211
Visualizações
Nodejs countdown when left will do some function

I have a web Application and i wanna to add a function. the function as a table will show inside it some result if the user post a request. and if user not post any thing will show different result when the time left. I work with nodeJs and ejs as view engine. and mongoose as database

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

0

  1. I think you want a function to run, if user submits a form. In this case you can use addEventListener method. An example code:
const form  = document.getElementById('myForm');

form.addEventListener('submit', () => {
    /*You can write any code here*/
});
  1. If you want to see a successful post request, (in other words if the visitor has sent data to node.js and if node.js successfully saved this data inside database), then you can set res.status(201) in your node.js file. And then detect 201 from your ejs file and then run your method. You can check this question, if you want a solution with 201: How to get 201 status when uploading a file?
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