I have data coming in XML file, and initially i was using jQuery Ajax function to read and process data in XML file... whole functionality works perfectly until i have tried on IE 9 browser and have so many different solution but is just not read data through XML file.I am using data type ($.browser.msie) ?
"text" and xml for rest of browser, followed by i am calling parseXml() for IE but is just not happening .... I am really struggling and thinking to change other possible method that is suitable for all!!!
function testXml() {
$.ajax({
type: 'GET',
url: 'XML_estatesIT_op4.xml',
dataType: ($.browser.msie) ? "text" : "xml",
success: function (xml) {
theXml = parseXml(xml);
$(theXml).find("property").each(function () {
var b1 = $(this).find('proptype').text();
alert(b1);
});
},
error: function () {
alert("An error occurred while processing XML file.");
}
});
}
function parseXml(xml) {
if (jQuery.browser.msie) {
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(xml);
xml = xmlDoc;
}
return xml;
}
I am wondering if i can read
- xml data in ajax function
- if it success, convert xmlDocument object into JSON
- then process on data, so that i can read in IE and other browsers...
I havn't use JSON, can anyone please guide me if i can do that!!
many thanks