Bug Tracker

Ticket #4975 (closed bug: duplicate)

Opened 5 years ago

Last modified 5 years ago

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

comment:1 Changed 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

Duplicate of #4958.

Note: See TracTickets for help on using tickets.