Hello!
I am trying to access a value in a json object and can's figure out how, I do an ajax request using jquery abnd get the data in this form
how could I access the long_name value in comcomute which should give me 3456, I have been trying several ways but all give me undefined, I tried things like response['results']['components'] etc. and also response.results.components but nothing works, I am obviously doing something wrong but I am learning and can't figure out how to, can someone give me an example?Code:{ "results" : [ { "components" : [ { "name" : "2203A", "short_name" : "2203A", "type" : [ "comname" ] }, { "long_name" : "Component default", "short_name" : "Component Default", "type" : [ "comrouter" ] }, { "long_name" : "3456", "short_name" : "34", "types" : [ "comcomute" ] }, etc...



Reply With Quote



Bookmarks