Javascript - why do I sometimes fail to read file content with GDownloadUrl?

Posted by Daj pan spokój on Stack Overflow See other posts from Stack Overflow or by Daj pan spokój
Published on 2010-04-16T14:11:52Z Indexed on 2010/04/16 21:33 UTC
Read the original article Hit count: 381

Filed under:
|
|

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");

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about file-io