$.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
随机推荐
- 【转】CEF3加载网页---多字节字符集和UNICODE字符集
static char* MBSCToCEF(const char* mbcsStr) { wchar_t* wideStr; char* utf8Str; int charLen; charLen ...
- 创建vue项目
1.创建项目 vue creat 项目名 // 要提前进入目标目录(项目应该创建在哪个目录下) // 选择自定义方式创建项目,选取Router, Vuex插件 2.启动/停止项目 npm run se ...
- ubantu 设置默认python3.叽叽叽的环境变量
wkp 发表于 2017-8-22 17:49:08 | 只看该作者 sudo vi ~/.bashrc 在里面加一句 alias python='python3' 或者再简单一点 alias p=' ...
- 2019-03-25-day018-面向对象
re模块 字符串匹配 列表 = findall(正则表达式,待匹配的字符串) 找所有 结果集 = search 找第一个,结果集.group() 结果集 = match 从第一个字符开始匹配,结果集. ...
- strcmp,stricmp
strcmp,stricmp:原型:int strcmp(const void *s1, const void *s2);功能:比较字符串s1和s2是否相同,区分大小写. 说明:如果s1=s2则返回零 ...
- html页面中的title设置为空格
这样页面加载时,title会显示为空,而不是当前页面的URL. document.title='\u200E'
- Too much thinking! Too much annoying.
I am now in great demand for an opportunity to yearn for, the ability to express myself, in a maximu ...
- pprof进行golang程序性能分析
一.导入包 import _ "net/http/pprof" 二.启动监控routine go func() { http.ListenAndServe("0.0.0. ...
- Ubuntu Core 网络配置
/********************************************************************************* * Ubuntu Core 网络配 ...
- render finished