What does “async: false” do in jQuery.ajax()?

后端 未结 7 1575
北海茫月
北海茫月 2020-11-22 01:47

Specifically, how does it differ from the default ( async: true ) ?

In what circumstances would I want to explicit set async to fals

相关标签:
7条回答
  • 2020-11-22 02:49

    If you disable asynchronous retrieval, your script will block until the request has been fulfilled. It's useful for performing some sequence of requests in a known order, though I find async callbacks to be cleaner.

    0 讨论(0)
提交回复
热议问题