I need to load a JSON file in my app in JavaScript.
The json file is like this:
{
"list": [
{
"item1": "text",
"item2": "text",
"item3": "text",
"item4": "text"
},
{
"item1": "text",
"item2": "text",
"item3": "text",
"item4": "text"
},
...
]
}
I've searched, but I always find solutions using AJAX and PHP, but I don't (and I can't) use any PHP server. So I've looked from the side of jQuery and the getJson() function, but that's didn't work, the JavaScript JSON.parse() didn't work for my file.
So, do any of you know how to load a local file with JavaScript or any other API?
$.getJson()should already parse the JSON, no need to call JSON.parse().