$.post() 和 $.get() 如何同步请求
由于$.post() 和 $.get() 默认是 异步请求,如果需要同步请求,则可以进行如下使用:
在$.post()前把ajax设置为同步:$.ajaxSettings.async = false;
在$.post()后把ajax改回为异步:$.ajaxSettings.async = true;
如:
$.ajaxSettings.async = false;
$.post("/finance/getLastTimeCard", data, function(result) {
// 请求处理
},"json");
$.ajaxSettings.async = true;
原文:https://blog.csdn.net/sunnyzyq/article/details/78730894
随机推荐
- C#中三层架构UI、BLL、DAL、Model实际操作
三层架构分为:表现层(UI).业务逻辑层(BLL).数据访问层(DAL)再加上实体类库(Model) 转载请注明出自朱朱家园https://blog.csdn.net/zhgl7688 1.实体类库( ...
- 10.3.1 iOS启动画面横屏是怎么回事?
产生这个问题的原因是编译旧版Delphi建立的项目,二种解决方法: 1.用 10.3.1 重建空工程,再把使用的单元文件重新加进来.这个操作有点麻烦,尤其对于使用单元多的文件,不过,有种方法,就是先把 ...
- python Django rest-framework 创建序列化工程步骤
11创建项目 2创建应用 3stting添加应用(apps)-添加制定数据库-修改显示汉字(zh-hans)-上海时区(Asia/Shanghai) 4主路由添加子路由 5应用里创建子路由 6创建数据 ...
- C# Sublime text3 环境配置(一)
下载地址:http://www.sublimetext.com/3 1.安装完之后,tools菜单下最下一个点一下,安装Package Control 插件2.Preferences菜单下,点Pack ...
- 2017ICPC南宁赛区网络赛 Overlapping Rectangles(重叠矩阵面积和=离散化模板)
There are nnn rectangles on the plane. The problem is to find the area of the union of these rectang ...
- POJ 2234 Matches Game(Nim博弈裸题)
Description Here is a simple game. In this game, there are several piles of matches and two players. ...
- 【Python】混合驱动实例
keywords2.txt: get||ie||{urls.txt} get||chrome||http://www.iciba.com main.py: from selenium import w ...
- Anaconda 的基本使用
Anaconda常用的Python版本管理工具和Python包管理软件,conda是Anaconda中的具体管理工具,下载地址为: https://www.anaconda.com/distribut ...
- Android: protecting the kernel
Linux内置安全机制 Address space separation/process isolation unix permissions DAC capabilities SELinux sec ...
- 【leetcode】20-ValidParentheses
problem Valid Parentheses code class Solution { public: bool isValid(string s) { stack<char> p ...