jQuery.ajax handling continue responses: “success:” vs “.done”?

前端 未结 3 1478
情歌与酒
情歌与酒 2020-11-22 09:51

I have been working with jQuery and AJAX for a few weeks now and I saw two different ways to \'continue\' the script once the call has been made: success: and <

3条回答
  •  醉话见心
    2020-11-22 10:06

    If you need async: false in your ajax, you should use success instead of .done. Else you better to use .done. This is from jQuery official site:

    As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done().

提交回复
热议问题