Can we get current update from AJAX request?

I want to send an AJAX request to server, while in the server the following operations happen in the following order:

  • Validation
  • Sanitising inputs
  • Inserting data to DB

Can I show user the current operation status of AJAX request?

For example: When the request has finished validating user inputs (in backend) I want to show user on front-end saying, “validating finished, and sanitising process is running” and the same for the next processes.

How can I accomplish that?

It’s really not worth bothering to do this. You have to keep in mind that:

  1. The server-side validation, sanitizing, and inserting to the DB should be so quick that it’s pointless to inform the user about this.

  2. The vast majority of users probably wouldn’t understand the messages anyway, nor would they care.

Having a UI that informs the user of the what is happening behind the scenes is only practical when you have long-running processes where the user will be kept waiting, and even then it’s mostly just to reassure them that something is happening and it’s not gotten stuck!

4 Likes

Okay thank you for the information.

So, can we do at least for long running processes (by AJAX)?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.