ibm worklight stored procedure

China☆狼群 提交于 2019-12-25 18:31:02

问题


I want to parse this json object in javascript and have to obtain the values of key pass in string format.

{
   "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:


If you are asking in a general sense (no links to Worklight) I would look at other answers:

How do I iterate over a JSON structure?

JavaScript loop through json array?

How do I loop through or enumerate a JavaScript object?

In Worklight, if your example is the response of a Worklight adapter, the response will be in a property called invocationResult.

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



来源:https://stackoverflow.com/questions/22935212/ibm-worklight-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!