ajax传递的参数服务器端接受不到的原因
最常见的就是组织的json数据格式有问题,尝试把单引号改为双引号试试,如下:
$datares = {"uname":$uname.val(),"phone":$phone.val(),"city":$city,"bmoney":$bmoney.val(),"sex":$sex,"province":$province ,"city":$city,"trade":$trade,"timelime":$timelime,"btime":$btime,"buse":$buse}; $.ajax({ url : '/test/a.php', type : 'post', data :$datares, dataType : 'json', //contentType: false, //processData: false, async : false, success : function(data) { if (data.status == 'success'){ alert(data.info); location.reload(); } else { alert(data.info); } } });
以上是我今天遇到的问题,查了半天。
朝朝暮暮.