Skip to main content

Bug Tracker

Side navigation

#4975 closed bug (duplicate)

Opened July 27, 2009 09:29AM UTC

Closed November 18, 2009 02:36AM UTC

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.

Attachments (0)
Change History (1)

Changed November 18, 2009 02:36AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #4958.