I've parsed the json string and I am trying to access the elements. I am unable to access link1, link2, link3
{
"click_title":"GO",
"links":
{
"commonlink":"http:\/\/bookings.com",
"alllinks":
[
[
{
"link1":"http:\/\/xyz1.com\/get\/a",
"link2":"http:\/\/www.anotherwebsite1.com\/c\/t",
"link3":"http:\/\/www.newsite1.com\/v\/h"
},
{
"link1":"http:\/\/xyz2.com\/get\/a",
"link2":"http:\/\/www.anotherwebsite2.com\/c\/t",
"link3":"http:\/\/www.newsite2.com\/v\/h"
}
],
[
{
"link1":"http:\/\/xyz3.com\/get\/a",
"link2":"http:\/\/www.anotherwebsite3.com\/c\/t",
"link3":"http:\/\/www.newsite3.com\/v\/h"
}
]
]
}
}
var data = $.parseJSON(dbData);
I am able to access click_title and commonlink using this :-
data.click_title
data.links['commonlink']
but not able to access link1, link2, link3. I tried
data.links['alllinks'] which returns [object Object].
If I try
data.links['alllinks']['link1'] i get undefined