写个方法获取:
function getJsonValue(obj,name){
var result = null;
var value = null;
for(var key in obj){
value = obj[key];
if(key == name){
return value;
} else {
if( typeof value == "object" ){
result = getJsonValue(value,name);
}
}
}
return result;
}
var jsonobj = { "semantic":{"taskId":"8.4.3"},"history":"cn.xxxx.fund"};
var taskId = getJsonValue(jsonobj,"history");
console.log(taskId);