|
楼主 |
发表于 2016-1-20 00:56:36
|
显示全部楼层
看了源码,还是不知道怎么用baas.sendRequest 得到 servlet的返回(response.getWriter().write("LogFail");)
就是这种返回怎么得到呢?
V3.2.1 只找到model\UI2\demo\baas.js 源码包括:
sendRequest : function(options) {
var self = this;
$.ajax({
"type" : "post",
"async" : options.async ? options.async : false,
"dataType" : "json",
"url" : this.BASE_URL + options.url,
"data" : {
"action" : options.action,
// 序列化参数JSON字符串
"params" : JSON.stringify(options.params)
},
"complete" : function(xhr) {
if (xhr.readyState == 4 && xhr.status == 200) {
if (options.success) {
options.success.call(this, xhr.responseJSON, xhr);
};
} else {
var msg = self.getErrorMsg(xhr);
if (options.error) {
options.error.call(this, msg, xhr);
} else {
self.showError(msg);
}
}
}
});
}, |
|