Is there any analog to a 'finally' in jQuery AJAX calls?

后端 未结 6 517
北荒
北荒 2021-02-04 22:45

Is there a Java \'finally\' analogue in jQuery AJAX calls? I have this code here. In my always I throw an exception, however I ALWAYS want it to go to the

6条回答
  •  -上瘾入骨i
    2021-02-04 23:46

    Just a note for those who use jQuery 3.0 and later

    Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    As in official documentation

提交回复
热议问题