getJSON函数实现自定义参数

$(document).ready(get_xxxx_list);

function get_xxxx_list(){

{% autoescape off %}

svcs ={{servers}};

{% endautoescape %}

for (var i=0; i< svcs.length; i++)

{

var svc = svcs[i]

var url = ‘http://’ + svc + ‘/xxxx.json’;

$.getJSON(url, {}, handle_xxxx_list(svc));

}

}

 

function handle_xxxx_list(server){

return function(json, status){

if(status == “success”){

for(var prj in json.d3all){

var objprj = json.d3all[prj]

for(var i = 0; i < objprj.length; i++){

var spider = objprj[i]

alert(server + prj + spider)

}

}

}else{

 

}

}

}