jQuery, AJAX and Internet Explorer

Internet Explorer won’t parse XML quite as easily as every other browser on the internet (I assume). You have to change what you pass it as through jQuery. In IE it has to be passed as text, while the rest can handle it as XML. You also have to pass it through a separate function that brings in ActiveX before you can navigate your way through the XML and use it in your application.

The solution:
Set the type to “text” for IE and “xml” for the rest.

	type: 'GET',
	url: 'sample.xml', // your xml file
	dataType: ($.browser.msie) ? 'text' : 'xml', // text for IE, xml for the rest
	success: function(xml) {
		var newXML = parseXml(xml);
		// and then process normally
	}, // end success
		error: function(a, b, c) {
		alert('error'); // this is where the errors happen, 'b' and 'c' are typically the only ones with values
	} // end error
}); // end .ajax

function parseXml(xml) {
	if (jQuery.browser.msie) {
		var xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
		xml = xmlDoc;
	return xml;

Reference the function in your .ajax()

success: function(xml) {
	var newXML = parseXml(xml);