How to make $.get() function synchronous in jQuery?

后端 未结 3 1037
时光取名叫无心
时光取名叫无心 2020-12-20 21:38

I want to make $.get() method synchronous in my function. In ajax aysnc : false helps me, now how do i do the same to to $.get()

va         


        
3条回答
  •  天命终不由人
    2020-12-20 22:11

    $.get also accepts parameter like this

    $.get({
      url: url,// mandatory
      data: data,
      success: success,
      dataType: dataType,
      async:false // to make it synchronous
    });
    

提交回复
热议问题