访问javascript数组

时间:2016-05-17 07:03:24

标签: javascript rest dynamics-crm-2011 odata

我得到一个对象作为api调用的响应

对象如下所示

enter image description here

现在,当我尝试response._modifiedby_value时,我得到了正确的答案,但是当我尝试response.createdby_value@OData.Community.Display.V1.FormattedValue时,我收到以下错误

Uncaught SyntaxError {message: "Unexpected token ILLEGAL"}

1 个答案:

答案 0 :(得分:4)

那是因为'@'是一个特殊字符,所以你不能这样做:

response.createdby_value@OData = 2;

但是

response["createdby_value@OData"] = 2;