Jquery的 ajax方法 一直提交不到后台去 救急。高了一天了。
var postdata = {
"userrealname": $("#userrealname").val(),
"usersex": $("input[name='usersex']").val(),
"usercards": $("#usercards").val(),
"province": $("select[name='province']").val(),
"city": $("select[name='city']").val(),
"district": $("select[name='district']").val(),
"detailaddress": $("#detailaddress").val(),
"usertel": $("#usertel").val(),
"salesmodel": $("input[name='salesmodel']").val(),
"shophttp": $("#shophttp").val(),
"userpostcode": $("#userpostcode").val(),
"userinstancy": $("#userinstancy").val(),
"userhometel": $("#userhometel").val(),
"userfax": $("#userfax").val(),
"useremail": $("#useremail").val(),
"userqq": $("#userqq").val(),
"userbank": $("#userbank").val(),
"accountbank": $("#accountbank").val(),
"bankname": $("#bankname").val(),
"toprovider": $("#toprovider").val(),
"shopname": $("#shopname").val(),
"shopcountry": $("select[name='shopcountry']").val(),
"shopprovince": $("select[name='shopprovince']").val(),
"shopcity": $("select[name='shopcity']").val(),
"shopdistrict": $("select[name='shopdistrict']").val(),
"shopaddr": $("#shopaddr").val(),
"usershoptel": $("#usershoptel").val(),
"shop_area": $("input[name='shop_area']").val(),
"checks[]": $("input[name='checks[]']").val(),
"userpassword": $("#userpassword").val(),
"date": new Date().getTime()
};
$.ajax({
type: "POST",
url: "/WorkShow/Registration/Ajaxpage/ShopkeepRegist.ashx",
data: postdata,
contentType: "application/json; charset=utf-8",
dataTpye: 'json',
success: function (msg) {
var i = parseInt(msg);
if (i > 0) {
window.location.href = "/WorkShow/Registration/ShopkeeperRegistThree.aspx?usersextend=" + msg;
} else {
alert("添加失败!");
}
},
error: function () {
alert("出错了!!!");
}
});
没有调用success回调函数,路径没有错误。求解答啊
[解决办法]
LZ可以在ASHX里设置断点,看服务器是否已经响应。AJAX如果没有提交,LZ看下是否直接进入ERROR了?是的话,同样可以设置断点,看下错误信息
现在是直接进入error回调了,进入error之后又进入了后台添加数据。
火狐是这样的,IE的是执行了success回调。