Here is some JSON data I am working with:
{
"lang": [
{
"SECTION_NAME": {
"english": "My title"
},
"SECTION_NAME_2": {
"english": "My title"
}
}
]
}
I am trying to display the value in this format:
$.getJSON('json/lang.json', function(data) {
var text = data['lang']['SECTION_NAME'];
$('#title').html(text.english);
});
However, I am encountering the following error:
TypeError: undefined is not an object (evaluating 'text.english')
Can anyone please provide assistance?
Thank you.