In a table.js
javascript file I have the following code
var data = '[{"id": "234", "name":"test"}, {"id": "124", "name":"test2"}]';
Instead of writing the JSON directly on the table.js, I want to put it in a separate file an load it. I tried this code
$.getJSON("data.json", function(data) {
....
});
I got the error
$.getJSON is not a function