I have a method like this
var getStatus = function (tr, startTime, endTime) {
var toReturn ="";
$.getJSON('../java_output/bugs.json', function (dataOuter) {
//random code here//
//code causes changes to 'toReturn'
});
return (toReturn);
}
Basically, I call getStatus and get a return value, which depends on the getJSON file. However, because it's a callback method, I don't get the current version of toReturn, and instead, get "" as the value because that's how it was initialized.