I have a function that is calling getJSON to retrieve a local file, but it doesn’t work.
The function is:
function login(email, password) {
console.log('in login');
$.getJSON("./config.json", function(config) {
console.log('in getJSON, config = ', config);
});
console.log('aft getJSON');
}
The message stack is:
in login
aft getJSON
As you can see, the process flow doesn’t get into the callback function and I can’t figure out why, as the file definitely exists.
Can anyone give me some ideas why getJSON doesn’t appear to be finding the file or maybe another reason why it isn’t working or a better way to read a local file?