I'm trying to get JSON data from a local file with :
$.getJSON(file, function(json_data) {
console.log(json_data);
}).fail(function(jqXHR, textStatus, errorThrown) { alert('getJSON request failed! ' + textStatus); });
But despite my file is a valid JSON file according to https://jsonlint.com/, I always get the ParseError.
I tried to just get the content with a $.get(...)
request, but, if I do so, I get an <empty string>
content.
Could anyone help me ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…