I'm using AJAX to load in a KML file (which is basically an XML file). I'm able to parse everything fine in IE9, FF, etc., but in IE8 it doesn't work. I get the data back but I'm not able to parse it in jQuery. I'm assuming this is because it's not being acknowledged as true XML. If I change the file from us_states.kml to us_states.xml, for example, it works fine. So, I COULD try to have people change their files from kml to xml manually, but I'd prefer being able to read it in and have it work on all browsers, old and new. Here is my ajax call:
$.ajax({
url: KMLFile,
type: "GET",
dataType: "XML",
success: function(data){ ...}
});
Thanks in advance for your help.
I'd skip the XML/KML issue completely and go straight to JSON:
http://code.google.com/p/geoxml3/wiki/JsonObjects
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With