Here is my Json data:
[{'ok' : false, 'details' : [{'n' : 'Email', 'v' : 'The email address you entered is not correct.'}, {'n' : 'NameFull', 'v' : 'Please enter your full name.'}] }]
I found read sigle-level Json data is super-easy but for multi-level data like above I couldn’t find an answer by search the internet. I just want to read above values. Like reading value from ‘n’ and ‘v’ under the ‘details’.
The data is inside an array
Note the square brackets around your data. You will have to index into the array in the above set of data.
This should let you access the email value:
And this is the alert text that appeared:
Maybe your JSON source put it inside an array because they want to return multiple elements?
And actually, you don’t need jQuery for this. JSON stands for JavaScript Object Notation. That basically means that it is a Javascript block of code that can be evaluated as-is directly in JavaScript to get the serialized data, which, in your case happens to be an array.