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

97
Vistas
How to make sure a webpage user's post request is processed successfully on the server side before the client can go to the next page in Node JS?

I am using javascript and Node JS to build a website to collect data for my writing research. The website is designed with a series of webpages with each page housing a different typing or writing task. Participants need to complete a task on one page, click the submit button to post the data to the server side, and click next to move on to the next page until they reach the last page of the study. For your information, here is the website I created: https://writingresearch.herokuapp.com.
However, here comes one issue: in some cases, when the internet connection on the client side is weak or unstable, it might take some time (say, more than 2 seconds) for the data to reach the server side for processing. In other words, the participant of the study may go to the next page before their posted data are successfully processed on the server side. If this happens, the server side ends up losing the data. Thus, I am wondering if there is a method to enable the communication between the server side and the client side so that the user of the website cannot go to the next page until their post request is successfully processed. Does anyone know how to do this in Node JS? I hope I have explained my question clearly. Thanks for your time and attention. I really appreciate your help!!!

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

0

On pressing the submit button, you should do the following:

  1. Disable the "Submit" button so that user doesn't send another POST request again by clicking on submit button again. Show a loader somewhere so that user could know that answer is being submitted.

  2. Disable the "Next" button until you receive a successful response from server.

  3. On receiving successful response from server, enable both buttons and show a notification (such as an alert box) informing that the answer is submitted successfully.

  4. If you receive error from server, then also show the error in the notification (or in the alert box) and enable both buttons.

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