I am attempting to iterate through this JSON format, I have tried following this method but I am a bit confused with my code How to iterate JSON array in JavaScript?.
Also, I have a question, is this actually a valid JSON format or something different because I have never seen such formats before.
{
"pageId":"2001",
"segments":"15",
"cacheable":"Y",
"compagedetailsails":[
{
"compid":"MOTP_HELP_TXT",
"masterkey":"104_MOTP_HELP_TXT",
"pagedetails":[
{
"key":"MOTP_HELP_TXT",
"val":[
"One Time Password has been sent to your mobile number. Click on resend in XXX seconds."
]
}
]
},
{
"compid":"MOTP_EXP_SEC",
"masterkey":"104_MOTP_EXP_SEC",
"pagedetails":[
{
"key":"MOTP_EXP_SEC",
"val":[
"120"
]
}
]
},
{
"compid":"MOTP_SUCC_ACT",
"masterkey":"104_MOTP_SUCC_ACT",
"pagedetails":[
{
"key":"MOTP_SUCC_ACT",
"val":[
"LMONUSPR"
]
}
]
},
{
"compid":"bcksignotp",
"masterkey":"104_bcksignotp",
"pagedetails":[
{
"key":"N104_bcksignotp0",
"val":[
"mxback"
]
},
{
"key":"N104_bcksignotp1",
"val":[
""
]
},
{
"key":"N104_bcksignotp2",
"val":[
"0"
]
}
]
}
]
}