This is an external 'data.json' sample to be formatted like this:
{
"A": [{"title": "Accountant", "name": "Adam"}],
"B": [{"title": "Beefeeter", "name": "Brandon"}],
"C": [{"title": "Coder", "name": "Charles"}],
"D": [{"title": "Doctor", "name": "David"}]
}
And this is the JS part for it with questions in //....
<script>
$(document).ready(function(){
$.getJSON("data.json", function(data){
$('title').html(data....title); // What is the best way to access/get the value of title, say Beefeeter in B?
$('name').html(data....name); // What is the best way to access/get the value of name, say Coder in C?
.....
});
});
</script>
Thank you for helping.
data.B[0].title,data.C[0].name