87,903
社区成员
发帖
与我相关
我的任务
分享
function loads(){
var initPath = 'http://192.168.81.177:8089/di-data-service/';
var reports = ['cpu_report','mem_report','load_report','network_report'];
var currentPath = initPath + 'r=day&json=1&cName=' ;
$.each(reports,function(index,report){
rendering( currentPath +report , index );
})
}
function rendering(data , index ){
$.ajax({
url: url,
type : "get",
dataType:'jsonp',
jsonp:"jsonpCallback",
success: function(result) {
//parse result , logic
//logicFun(result , index );
console.log('rendering - '+index);
}
}
function logicFun(data , index ){
//parse data , logic
console.log('logicFun - '+ index );
}
function loads() {
var initPath = 'http://192.168.81.177:8089/di-data-service/';
var reports = ['cpu_report', 'mem_report', 'load_report', 'network_report'];
var currentPath = initPath + 'r=day&json=1&cName=';
rendering(currentPath, 0, reports);
/*
$.each(reports, function (index, report) {
rendering(currentPath + report, index);
})*/
}
function rendering(currentpath, index,reports) {
$.ajax({
url: currentpath + reports[index],
type: "get",
dataType: 'jsonp',
jsonp: "jsonpCallback",
success: function (result) {
//parse result , logic
//logicFun(result , index );
console.log('rendering - ' + index);
index++;
if (index < reports.length) rendering(currentpath, index, reports);
}
});
}
function logicFun(data, index) {
//parse data , logic
console.log('logicFun - ' + index);
}