Ticket #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: | ||
| Blocking: | Blocked by: |
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.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Duplicate of #4958.