jQuery.post( ) .done( ) and success:

前端 未结 4 1667
孤独总比滥情好
孤独总比滥情好 2020-12-01 03:44

jQuery documentation on jQuery.post( )

// Assign handlers immediately after making the request,
// and remember the jqxhr object fo         


        
4条回答
  •  情话喂你
    2020-12-01 04:19

    Both .done() and .success() are callback functions and they essentially function the same way.

    Here's the documentation. The difference is that .success() is deprecated as of jQuery 1.8. You should use .done() instead.

    In case you don't want to click the link:

    Deprecation Notice

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

提交回复
热议问题