|

楼主 |
发表于 2016-12-23 14:40:12
|
显示全部楼层
这是我的代码
Model.prototype.button2Click = function(event){
var data = this.comp('data1');
$.support.cors = true;
$.ajax({
"async" : "true",
"url": "http://****/OnlineSer.asmx/GetRemotTaskJSONTest",
"type": "post",
"dataType": "json",
//"contentType": 'application/json', 此处不能要
//"data": {"a":"2",
// "b":"3"},
success: function(jsonObj){
data.loadData(jsonObj.Table);//将返回的数据加载到data组件
},
"complete": function (xhr) {
alert(xhr.status);
if (xhr.readyState == 4 && xhr.status == 200) {
//altert(options.success.call(this, xhr.responseJSON, xhr));
alert(xhr.responseText);
}
else{
alert("fail");
}
}
});
}; |
|