Opened 14 years ago
Closed 13 years ago
#4975 closed bug (duplicate)
XML error in IE
Reported by: | wolkesau | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | ajax | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I use this way try to get "xml document" $.get("test.xml","",dealXML(),"xml");
It works in FF, but can not use in IE,I still get "string" data type in IE, than I google it ,found that the header Content must be "text\xml",but I use JQuery in a CD, so it`s impossible to change the header , but finally I found a way to solve this problem.
function parseXML( xml ) {
if( window.ActiveXObject && window.GetObject) {
var dom = new ActiveXObject( 'Microsoft.XMLDOM' ); dom.loadXML( xml ); return dom;
} if( window.DOMParser )
return new DOMParser().parseFromString( xml, 'text/xml' );
throw new Error( 'No XML parser available' );
}
I use this function to change the data to be XML document, and it work , hope it can help JQuery to be more powerful in the future.
Duplicate of #4958.