Javascript - why do I sometimes fail to read file content with GDownloadUrl?
- by Daj pan spokój
Hi everybody.
I try to read some file with google's GDownloadUrl and it works only from time to time.
failure means fileRows == "blah blah"
success means fileRows == (real file content)
I've noticed, however, that when I cease (with Firebug) the execution on line 3 for a couple of seconds, it succeeds more often. Maybe it is some kind of threading bug, then?
Do You guys have any tip or idea?
1 var fileContent = "blah blah";
2 availabilityFile = "input/available/" + date + ".csv";
3 GDownloadUrl(availabilityFile, function(fileData) {
4 fileContent = fileData;
5 });
6 fileRows = fileContent.split("\n");