一个标准的AJAX请求
2024-10-21 03:30:13
这是一个标准的ajax请求:
$.ajax({
type:"post",
url:basePath+"/resourcePush/operationLog",
async:false,
data: JSON.stringify(json),
contentType : "application/json;charsetset=UTF-8",
dataType:"json",
success: function(data){ },
error:function () { }
});
其中dataType是描述springMVCf返回的参数;
contentType是描述传递的参数,
如果默认不写的话,则SpringMVC对应注解是requestParam
如果是其它指定的,比如
contentType : 'application/json;charset=UTF-8',
contentType : 'text/html;charset=UTF-8',
则SpringMVC对应注解是requestBody
async:false,是同步
async:true,是异步
最新文章
- WPF学习之路(十一)布局(续)
- PL/SQL Block Structure
- 如何利用java得到当前的时间和前一天的时间
- 十九、【.Net开源】EFW框架核心类库之WCF控制器
- C#通过ODBC查询HANA数据库数据
- [CareerCup] 11.1 Merge Arrays 合并数组
- java.lang.NoClassDefFoundError: com/sun/mail/util/BEncoderStream
- 禁止使用finalize方法
- OAF_架构MVC系列3 - View的概述(概念)
- CPLD VS FPGA
- Qt之等待提示框(QTimer)
- js自动判断浏览器类型跳转到手机版
- CF Rook, Bishop and King
- 自定义Dictionary支持线程安全
- Cocos2d-x 3.2 Lua演示样例 XMLHttpRequestTest(Http网络请求)
- 《JAVA并发编程实战》示例程序 第三章
- python学习笔记3-列表
- Gluon Datasets and DataLoader
- combox的基本应用
- Manifest File