ibm worklight存储过程

时间:2014-04-08 11:11:21

标签: json adapter ibm-mobilefirst

我想在json中解析这个javascript对象,并且必须以字符串格式获取密钥传递的值。

{
   "isSuccessful": true,
   "resultSet": [
      {
         "name": "a",
         "pass": "123",
         "time_stamp": "2014-04-07T10:13:17.000Z"
      },
      {
         "name": "chetan",
         "pass": "123456",
         "time_stamp": "2014-04-07T10:13:34.000Z"
      },
      {
         "name": "dileep",
         "pass": "456321",
         "time_stamp": "2014-04-07T10:13:54.000Z"
      },
      {
         "name": "bnc",
         "pass": "654321",
         "time_stamp": "2014-04-07T10:19:37.000Z"
      }
   ]
}

1 个答案:

答案 0 :(得分:0)

如果您在一般意义上提问(没有指向Worklight的链接),我会查看其他答案:

How do I iterate over a JSON structure?

JavaScript loop through json array?

How do I loop through or enumerate a JavaScript object?

在Worklight中,如果您的示例是Worklight适配器的响应,则响应将位于名为invocationResult的属性中。

另见https://www.ibm.com/developerworks/community/blogs/worklight/entry/handling_backend_responses_in_adapters?lang=en