您的位置:首页 > Web前端 > JavaScript

ajax只返回success 不要指定dataType为json

2018-03-14 16:26 495 查看
$.ajax( {
type : "GET",
contentType : "application/json",
data : {
customerId: customerId,
mappingType : mappingType,//3个入参
siteType : siteType,
innerName: encodeURIComponent(a),
innerId: b,
outName: encodeURIComponent(cc),
outId : dd
},
// dataType : 'json',
url : "addMapping",
async : true,
success : function(msgs) {  //controller(@ResponseBody不能少)返回的是 "success",才能进入成功的回调
//保存成功后,进行查询
ajaxUserList();
},
error : function(mm, a, b, c, d, e) {
alert(lang_servererr);
}
});
$.ajax( {
        type : "GET",
        contentType : "application/json",
        data : {
            customerId: customerId,
            mappingType : mappingType,//3个入参
            siteType : siteType,
            innerName: encodeURIComponent(a),
            innerId: b,
            outName: encodeURIComponent(cc),
            outId : dd
        },
        // dataType : 'json',
        url : "addMapping",
        async : true,
        success : function(msgs) {
            //保存成功后,进行查询
            ajaxUserList();
        },
        error : function(mm, a, b, c, d, e) {
            alert(lang_servererr);
        }
    });
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐