When running my data, I utilize the following function:
function loadData(){
const loader = THREE.FileLoader();
let loadedData = [];
loader.load( correctFileUrl,
function (data) {
console.log(data);
for (let row of data.split('\n'))
{
loadedData.push(row);
}
},
function (xhr) {console.log(('Loaded data: ' + xhr.loaded / xhr.total * 100) + '% completed')},
function(err) {console.error(err)}
);
return loadedData;
}
In this scenario, correctFileUrl
represents the accurate hashed URL of the file I wish to load (which is a simple CSV containing strings for each row).
Despite being able to log the content of the file and confirming it is loaded correctly, the method consistently returns an empty list. As someone new to JavaScript, I'm puzzled as to why it's not functioning as anticipated.