for some reason, the code can't open the local file. currently my file is located at C:/file_folder/file_name
here's the code:
function loadJSON(callback)
{
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', './file_folder/file_name', true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
callback(JSON.parse(xobj.responseText));
}
};
xobj.send(null);
}
is my url wrong?