Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将新属性插入JSON_Json_Texturepacker - Fatal编程技术网

将新属性插入JSON

将新属性插入JSON,json,texturepacker,Json,Texturepacker,我知道我可以像这样在JSON中插入新属性: var jsonObj = { members: { host: "hostName", viewers: { user1: "value1", user2: "value2", user3: "value3" }

我知道我可以像这样在JSON中插入新属性:

var jsonObj = {
    members: 
           {
            host: "hostName",
            viewers: 
            {
                user1: "value1",
                user2: "value2",
                user3: "value3"
            }
        }
}

jsonObj.members.viewers["user4"] = "value4"; 
但是我需要使用的JSON是这样的(来自Texture Packer):


如何在“框架”中插入新属性?因为语言标记,我很困惑

您可以像这样简单地链接成员:

jsonObj.frames["chaingun.png"]["frame"]["z"] = 1234;

// or

jsonObj.frames["chaingun.png"].frame.z = 4567;
jsonObj.frames["chaingun.png"]["frame"]["z"] = 1234;

// or

jsonObj.frames["chaingun.png"].frame.z = 4567;