Hey I'm trying to read data from a JSON File with jQuery. This is my JS:
$(document).ready(function() {
var myItems;
$.getJSON('testData.json', function(data) {
myItems = data.items;
console.log(myItems);
});
});
And that is the JSON File:
{"fname":"rafael","lname":"marques","age":"19"}
{"fname":"daniel","lname":"marques","age":"19"}
When I open my HTML Page in the Browser I can't see nothing in the Console.
console.log, you can open the developer console to see the result.