berthao / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

Uncaught InvalidStateError: Failed to execute 'overrideMimeType' on 'XMLHttpRequest': MimeType cannot be overridden when the state is LOADING or DONE. #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call geoXml.parse('...') to load multiple resources, at different time 
point.  
2. In Chrome 39.0.2171.65 m, give error: 
    Uncaught InvalidStateError: Failed to execute 'overrideMimeType' on 'XMLHttpRequest': MimeType cannot be overridden when the state is LOADING or DONE.

What version of the product are you using? On what operating system?
Win7 Enterprise 64 bit. Chrome 39.0.2171.65 m.

Please provide any additional information below.

Error happens in geoXML3.fetchXML() function at 
xhrFetcher.fetcher.overrideMimeType('text/xml')

When geoXML3.fetchers.length > 0, the function is trying to reuse the 
XMLHttpRequest object, which is in DONE status and cause error when calling 
overrideMimeType. 

Here is my temporary solution, I haven't fully tested, but it works in my case:

move this line:  
      xhrFetcher.fetcher.open('GET', url, true);

to the front of:
      if (xhrFetcher.fetcher.overrideMimeType) {
        xhrFetcher.fetcher.overrideMimeType('text/xml');
      }

Calling open() at front will reset request status, so that overrideMimeType() 
won't complain DONE status.

Reference http://www.w3.org/TR/2006/WD-XMLHttpRequest-20060405/#dfn-open

Kevin

Original issue reported on code.google.com by jxdk...@gmail.com on 25 Nov 2014 at 10:12

GoogleCodeExporter commented 9 years ago
I am experiencing the same problem since the most recent Chrome update.

If you go to and click a route a few times you will see the error.
http://connect.ridetherapid.org/infopoint

Original comment by Kiel.Kni...@gmail.com on 26 Nov 2014 at 12:15

GoogleCodeExporter commented 9 years ago
Which branch of geoxml3 is being used?

Original comment by geocodezip on 26 Nov 2014 at 2:03

GoogleCodeExporter commented 9 years ago
Test page:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_update.html?lat=37.430
783&lng=-122.085125&zoom=10&type=m&filename=http://www.geocodezip.com/dynamicmar
kerkml.php

fixed in KML branch

Original comment by geocodezip on 26 Nov 2014 at 2:20

GoogleCodeExporter commented 9 years ago
fixed in KMZ branch (revision 117)

Original comment by geocodezip on 26 Nov 2014 at 2:22