2017  Kodetalk | Feedback | Privacy Policy | Terms | About

Issue in parsing server response data as JSON and display in autocomplete as tag

I am getting server response as below:

{"Data1":[{t1:'test',t2:'test1'},{ta:'test',tb:'test1'},{tc:'test',td:'test1'}], "data2":"somestring"}

now i am able to get the code as response.data2 and place it properly. But when i am trying to show the data response.Data1, i am getting data as [object, Object],[object, Object],[object, Object]. What should i do to make it work?


You can use below code to 1st convert data to string


And from here you an do the stuff you want to do for example if you want to convert string to JSON then user jQuery for parsing the string JSON.

Answer is