jquery::ajaxStop() versus jquery::ajaxComplete()

后端 未结 3 1467
孤街浪徒
孤街浪徒 2020-12-13 08:53

Which is to be used at which time.

In the documentation on http://api.jquery.com/:

For ajaxStop() it says:

Description: Register a h

3条回答
  •  情书的邮戳
    2020-12-13 09:50

    ajaxComplete is called whenever an ajax request finishes, either successfully or with an error.

    ajaxStop is called when all ajax requests complete. So unlike ajaxComplete, it won't be called if there is still a request in progress.

    You should use the first if the operation you want to perform should be done for every ajax request.

提交回复
热议问题