老哥们,ajax中json的data格式到底是怎么样啊
jquery吧
全部回复
仅看楼主
level 1
fyhfbjt 楼主
先附上代码:
$(document).ready(function(){
//注册
$("#signup").click(function(){
var User = $("#User").val();
var psw = $("#password").val();
if( User =='' || psw ==''){
alert("用户名及密码不能为空");
return false;
}else{
$.ajax({
url: '../PHP/signup.php',
type: 'post',
dataType: 'json',
data: 'User='+User+'psw='+psw,
success: function(data){
alert("11111111")
},
error : function(){
alert("0151024")
}
});
}
})
});
2017年08月13日 13点08分 1
level 1
fyhfbjt 楼主
'User='+User+'psw='+psw,这个代码有问题,这样写表单提交后数据库user的值为:user传入的值+psw=+psw传入的值,password的值则没有
2017年08月13日 13点08分 2
level 1
fyhfbjt 楼主
没人吗...._(:з」∠)_
2017年08月13日 14点08分 3
level 12
User:user,Pwd:pwd
2017年08月20日 02点08分 4
1