下面的代码似乎无法将 JSON 结果连接成字符串,有人知道为什么吗?
function wordCloud(filename)
{
var file = filename;
var text = " ";
$.getJSON(file, function(data) {
$.each(data, function(key, val) {
text = text.concat(val.toString());
});
});
console.log(text);
}
谢谢