Here is the hardcoded JSON string in the Javascript function:
var text = '{"employees":[' +
'{"firstName":"John","lastName":"Doe" },' +
'{"firstName":"Anna","lastName":"Smith" },' +
'{"firstName":"Peter","lastName":"Jones" }]}';
Data will be displayed below the button after you press it.
Here is what the JSON file that's being read looks like:
[
{
"name" : "Apple",
"color" : "red",
"origin": "U.S."
},
{
"name" : "Orange",
"color" : "orange",
"origin": "U.K."
},
{
"name" : "Strawberry",
"color" : "red",
"origin": "Japan"
}
]