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

后端 未结 7 1644
北海茫月
北海茫月 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:46

    • async:false = Code paused. (Other code waiting for this to finish.)
    • async:true = Code continued. (Nothing gets paused. Other code is not waiting.)

    As simple as this.

提交回复
热议问题