我如何访问外部的 json 数据$.getJSON,甚至有可能吗?如果没有,如何以其他方式做到这一点?
var json = [];
$.getJSON("test.json", function(data) {
   json = data;
});
// Here I want to display data from json
console.log(json["en"].name);
测试.json
{
    "en": {
        "name": "John"
    },
    "pl": {
        "name": "Jan"
    }
}