leaflet-gpx icon indicating copy to clipboard operation
leaflet-gpx copied to clipboard

IE8 compatibility

Open mpetazzoni opened this issue 10 years ago • 1 comments

On IE8 the XML isn't loaded into the responseXML object of the XMLHttpRequest but in response with the content type set to text/xml. The loading handler should be changed to something like this:

req.onreadystatechange = function() {
  if (req.readyState != 4) return;
  if (req.status == 200) {
      if (req.responseXML) {
          cb(req.responseXML, options);
      } else {
          try{
              var parser = new DOMParser();
              cb(parser.parseFromString(req.response, "text/xml"), options);
          } catch (e) {
              console.log(e);
          }
      }
  }
};

mpetazzoni avatar Aug 21 '13 23:08 mpetazzoni

Hi, please also follow the discussion here: http://www.wpquestions.com/question/show/id/8754 I had to fork your code as I implemented a php proxy to load gpx files from external domains to overcome cross-domain limitations - not all code for fixing IE8 might be usable out of the box. best, Robert

seyfro avatar Aug 22 '13 04:08 seyfro