$ .ajax在blackberry10 phonegap中不起作用,但在android phonegap中有效

时间:2013-09-20 05:39:24

标签: ajax cordova

$.ajax({ 
        async: true,
        type: "POST",
        url: "http://'localhost'/Health/appointment?DoctorName=" + u + "&Password=" + p + "&dbversion=1.3",
        contentType: "application/json",
        dataType: "jsonp",                               
        success: function (msg) {
             //alert("in success: " + JSON.stringify(msg) + " " + msg.flag + " " + msg.UserID + " " + msg.DoctorId);
            window.location.href = 'option.html?UserID=' + msg.UserID + '&DoctorId=' + msg.DoctorId;

        },error: function(response) {
            alert("in Error");
        }               
});

1 个答案:

答案 0 :(得分:0)

使用 dataType:json
而不是jsonp