Abort jQuery ajax request without calling error function -
In my app, if a user goes to a page that triggers an AJAX request to load the data So if they quickly navigate to another page, I no longer care about that request, but if I cancel it, then it triggers the error function, which displays an error alert.
I know that you can check inside the error function if it is "abortion", but I will not need to do this for every request. Ideally you can configure it with $ .ajaxSetup (), or there can be an argument that you can pass through the abort () function, there is no error to say, this request is no longer relevant and This does not mean to run my success, error or full work. According to all the documents, the fault function through the canceled call and its verification should be done only in the verification status.
Can be:
Comments
Post a Comment