Ajax请求默认的都是异步的 
如果想同步 async设置为false就可以(默认是true) 

var html = $.ajax({ 
  url: "some.PHP", 
  async: false 
}).responseText; 

或者在全局设置Ajax属性 
$.ajaxSetup({ 
  async: false 
  }); 
再用post,get就是同步的了

 

 

转载来源:http://blog.csdn.net/xiaoguang44/article/details/6454727

相关文章:

  • 2022-12-23
  • 2021-10-09
  • 2021-07-22
  • 2021-05-31
  • 2021-09-05
  • 2022-03-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-02-11
  • 2021-11-22
  • 2021-11-06
  • 2021-07-06
相关资源
相似解决方案