|
代码:
var ajaxData = {};
// 远程调用
var mpath = "http://127.0.0.1:8080/health/Actions/Internal/Basic/DataDictionaryAction.do?method=testMethod";
$.ajax({
"type" : "post",
"dataType" : "json",
"contentType" : "application/json",
"url" : mpath,
"data" : JSON.stringify(ajaxData),
"success" : function(json) {
alert(json);
},
"error" : function(request, textStatus, errorThrown) {
alert(request.status);
if (request.status == 404) {
var url = window.location.protocol + "//" + window.location.host + "/health";
throw new Error("无法连接到服务器:" + url);
} else {
throw new Error(errorThrown);
}
}
});
错误提示:
|
|