81,094
社区成员
发帖
与我相关
我的任务
分享
$.ajax({
async: false,
url: "http://192.168.1.102:7001/WebRoot/testInfoController/getAchievement.do",
type: "GET",
dataType: 'jsonp',
//jsonp的值自定义,如果使用jsoncallback,那么服务器端,要返回一个jsoncallback的值对应的对象.
jsonp: 'jsoncallback',
//要传递的参数,没有传参时,也一定要写上
data: {yhid:123},
timeout: 5000,
//返回Json类型
//contentType: "application/json;utf-8",
//服务器段返回的对象包含name,data属性.
success: function (result) {
alert(result.achievementList[0].yhid);
},
error: function (jqXHR, textStatus, errorThrown) {
alert(textStatus);
}
});