Multiple ajax requests
When we use ajax to request data, we may encounter the possibility of triggering multiple clicks at a time.
(For example, the onreadystatechange event of ajax is triggered multiple times, because onreadystatechange is an event handle.
Its value (state_Change) is the name of a function. This function is triggered when the status of the XMLHttpRequest object changes.
The status changes from 0 (uninitialized) to 4 (complete. The code is executed only when the status is 4 ."
This function is triggered every time the status of the XMLHttpRequest object changes.
It will be triggered four times in total, from 0 to 4 .) [PS: Of course, the example cited here does not fully meet the problem encountered at work.] at this time, we need a method to terminate the program.
Both exit and abort are functions used to terminate the program. The differences between the two are described below.
Exit will do some release work:Release all static global objects, cache, disable all I/O channels, and terminate the program. If a function is registered through atexit, the registered function is also called. However, if the atexit function throws an exception, it will directly call terminate.
Abort:Terminate the program immediately without any cleanup.
The above is all the content about ajax's multiple requests. I hope you can provide more support ~