如何更改动态嵌套javascript对象中属性的值?如何使用javascript更改嵌套对象中的值
例
对象: "chart": { "height": 400, "width": 600, "margin":{"top": 0, "right": 0, "bottom": 0, "left": 0},
"padding":{"top": 0, "right": 0, "bottom": 0, "left": 0}, "grid" : { "xEnabled":"yes", "yEnabled":"yes", "color": "#ddd" } },
我怎样才能使用JavaScript padding.top改变从0到20。
任何代码都会有帮助。
看看这个:http://css-tricks.com/forums/topic/need-help-with -javascript-inheritance-and-nested-objects/ – ctwheels 2014-08-27 19:12:18
我修改了一下我的问题。改变的关键和价值来自变量。那么我们应该如何实现它? – 2014-08-27 19:19:03