目前只有发ajax请求可以,getJSON、post 不行,有那两种解决方法可以留言
上代码:
$.ajax({
“url”:"/address/addAddress",
“data”: param,
“type”: “post”,
“contentType”:“application/x-www-form-urlencoded; charset=UTF-8”,//提交给数据端的数据类型 要不要当成字符串来接收
“processData”:true,//要不要处理提交的数据
“dataType”:“json”,//服务器返回的数据类型
success:function(data){
if(data.state==200){
layer.msg(data.msg);
}else{
layer.msg(data.msg);
}
}
});
"contentType":"application/x-www-form-urlencoded; charset=UTF-8", 加上这个比较有效。