您的位置:首页 > 其它

ajax进行前台到后台传输,传输方式为POST格式时的参数

2015-11-06 09:00 330 查看
$.ajax({
type :"POST",
async:false,
data : dataInfo,
timeout:300000,
contentType: "application/x-www-form-urlencoded",
url : abc,
dataType:"json",
success : function(response) {
result=response;
},
error : function(XMLHttpRequest, textStatus, errorThrown, data) {
alert("数据有误,请审核!");
}
});
利用POST方式,对应的contentType应该为application/x-www-form-urlencoded
利用GET方式,对应的contentType应该为application/json或者text
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息