javascript - JSON - how to convert plain format into json format? -



javascript - JSON - how to convert plain format into json format? -

i got response after invoke worklight adapter.

{"text": "{\n \"responsecode\" : \"00\",\n \"responsemsg\" : null,\n \"buildfromaccountsmap\" : {\n \"1000071000005844 d\" : \"1000071000005844\",\n \"1000791000030636 d\" : \"1000791000030636\",\n \"1001911000036935 d\" : \"1001911000036935\",\n \"1002021000029411 d\" : \"1002021000029411\",\n \"1005071000029666 d\" : \"1005071000029666\",\n \"1005071000033139 d\" : \"1005071000033139\",\n \"1005071000037533 d\" : \"1005071000037533\",\n \"1005071000038605 d\" : \"1005071000038605\",\n \"1005071000045298 d\" : \"1005071000045298\",\n \"1005071000045517 d\" : \"1005071000045517\",\n \"1005071000046989 d\" : \"1005071000046989\",\n \"1005071000056183 d\" : \"1005071000056183\",\n \"1005491000019560 d\" : \"1005491000019560\",\n \"2000071000163308 s\" : \"2000071000163308\",\n \"2000071000163361 s\" : \"2000071000163361\"\n }}

my worklight adapter

function buildfromaccounts(userid) { path = "xxxxxxxxxxxxxxxxx"; var input = { method : 'post', returnedcontenttype : 'plain', path : path, body:{ contenttype:'application/json; charset=utf-8', content: json.stringify({ "userid": userid.tostring() }) } }; homecoming wl.server.invokehttp(input); }

the problem is, how can convert plain format json format in worklight?

what did set returnedcontenttype? json or plain?

edit: since returning plain... seek akin following: var obj = json.parse(response.text)

javascript json worklight worklight-adapters

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -