Export to GitHub

earth-issues - issue #1332

AJAX requests sometimes return status code of 0 when should be 200


Posted on Dec 18, 2011 by Happy Kangaroo
  1. Google Earth Version: 6.1.0.5001

2. Operating System (Windows Vista Ultimate 64-bit, Mac OS X 10.4.9, etc): Win 7 64 bit

3. Summary of issue (including error messages): AJAX requests sometimes return status code of 0 even though request was successful

4. Links to other posts about this issue (please don't repost bugs):

5. Reproduction Steps: Open http://www.iliveinabin.com/ge-test/Networklink-ajax.kml

Zoom into Britain slightly and click the marker

Note the debug info at the top of the info window bubble

Click the link 'Test' multiple times, noting the debug info. This sends an AJAX request and prints how many AJAX requests have been made, the request textStatus, and the status and statusText properties of the XHR object.

Most times it is okay, but sometimes it will change to error and status 0. If you use an HTTP debugger such as fiddler, you will see that actually the failed request was successful, and the status returned for the requests was 200 or 304.

The error is intermittent, the most I have had to click the Test link until getting an error is 19 times.

The error seems to occur sometimes even when GE has cached the file and doesn't make a request to the server.

The js file can be viewed at: http://www.iliveinabin.com/ge-test/ge-not-min.js

6. What is the expected output or behavior? What do you see instead? The status should always be 200 for a successful request, instead it is sometimes 0.

7. Workaround (if you've found one) Use an error handler to handle failed AJAX requests. In the handler check whether the request really failed, or is just due to the GE bug. If due to the bug, fire the success handler.

Status: New

Labels:
Type-Issue