jquery 采用async:false同步加载数据
2013-03-27 16:21
302 查看
使用jquery的ajax去进行某些操作,默认是异步加载的方式。即在执行ajax对应后台操作时,前台的JS也会继续执行,并不会等jquery的ajax执行结束。有些情况下可能必须等到ajax执行完毕,才接着执行下面的语句的时候,需要在ajax中,加入一个参数: async:false。这样ajax就会采用同步的方式执行,等到ajax执行完毕再接着执行下面的语句。
async
Boolean
Default: true
By default, all requests are sent asynchronous (e.g. this is set to true by default). If you need synchronous requests, set this option to false. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is
active.
参考:http://www.cnblogs.com/xmphoenix/archive/2011/11/21/2257651.html
async
Boolean
Default: true
By default, all requests are sent asynchronous (e.g. this is set to true by default). If you need synchronous requests, set this option to false. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is
active.
参考:http://www.cnblogs.com/xmphoenix/archive/2011/11/21/2257651.html
相关文章推荐
- 采用table+jQuery加载数据,实现数据与表格布局的分离
- jQuery的ajax,当async为false时,同步操作失败。解决方案
- jQuery的ajax,当async为false时,同步操作失败。解决方式
- jquery实现页面提示,数据正在加载中。(
- thinkphp--foreach循环里面的jquery+ajax的点击事件的数据同步
- JQuery实现浏览器的滚动条滚动到底部后加载数据
- jQuery实现当拉动滚动条到底部加载数据
- 采用数据模型和数据库同步技术 -- TraceListener类
- Ext_表单数据加载(同步,异步)
- 利用jQuery的ajax从xml文件中加载数据
- jquery mobile 页面加载时采用ajax绑定页面数据
- 扩展了一棵jquery的树插件SimpleTree,加上了json格式数据异步加载能力
- jquery 实现滚动条至页面底端自动加载数据效果
- 在jQuery中利用AJAX加载XML数据并解析
- 采用rsync+inotify,实现多台web数据动态同步
- jquery实现瀑布流效果 jquery下拉加载新数据
- jquery实现页面提示,数据正在加载中
- Jquery-同步载入数据
- js/jquery控制页面动态加载数据 滑动滚动条自动加载事件的方法
- jquery-seat-charts 使用-自定义座位号 及 重新加载数据