"snapMaxFileSizeKB": 1024,
"upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
"localhost": false
},
"app": "dtube/0.7",
"beneficiary": "dtube",
"dmca": true,
"pageTitleSeparator": "-",
"appName": "DTube",
"ipfs": "",
您的数据已损坏。我不得不通过添加一些结构来重新创建数据来制作工作样本。在JavaScript中,您的数据将如下所示。
var someVariable = {
"server":{
"snapMaxFileSizeKB": 1024,
"upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
"localhost": false
},
"app": "dtube/0.7",
"beneficiary": "dtube",
"dmca": true,
"pageTitleSeparator": "-",
"appName": "DTube",
"ipfs": "",
};
这是一个基本对象。要访问该对象,请尝试
console.log(someVariable.server.localhost);
或者试试
console.log(someVariable["server"]["localhost"]);
设置值时尝试:
someVariable.server.localhost = "some value";
someVariable["server"]["localhost"] = "some other value";