首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

jQuery ajax - post() 步骤 同步

2012-10-21 
jQuery ajax - post() 方法同步Ajax请求默认的都是异步的 如果想同步 async设置为false就可以(默认是true)

jQuery ajax - post() 方法 同步

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

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

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

热点排行