帮助这让我疯了:
我有routeMapping varible包含这个:
{"b":[{"Ya":53.388639,"Za":-1.4785248000000593},{"Ya":53.39310538272831,"Za":-1.464529037475586}],"gm_accessors_":{"length":null},"length":2,"gm_bindings_":{"length":{}}}
这是有效的
alert('length is ' + (routeMapping.length -1))
这样做:
alert(routeMapping);
但不是这个!:
alert(routeMapping.b[1].Ya);
请帮助
答案 0 :(得分:0)
什么是执行上下文?
我刚刚在Chrome控制台上尝试了这个,它运行得很好。
我做了
var x = eval("(" + '{"b":[{"Ya":53.388639,"Za":-1.4785248000000593},{"Ya":53.39310538272831,"Za":-1.464529037475586}],"gm_accessors_":{"length":null},"length":2,"gm_bindings_":{"length":{}}}' + ")")
然后
x.b[1].Ya
它向我展示了53.38 ......正如预期的那样我认为
-ace