Skip to main content

Bug Tracker

Side navigation

#4519 closed bug (invalid)

Opened April 11, 2009 02:07PM UTC

Closed April 11, 2009 02:37PM UTC

Last modified March 15, 2012 02:29PM UTC

XML parsing error with IE

Reported by: nico87 Owned by: john
Priority: critical Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

This function works well in FF, but not in IE6.

$(xml).find("[name=\\"societa\\"]").children().each(function() {

menu1+="<span class=\\"inline-div padding20\\"><a href='"+$(this).attr("href")+"'\\">"+$(this).text()+"</a></span>";

});

Also I've tried to do this:

alert($(xml).find("[name=\\"societa\\"]").html())

and FF returns the correct XML code inside <item name='societa'> </item>. IE returns a empty string.

Follows the XML code:

<?xml version="1.0" encoding="UTF-8"?>

<menu>

<item name="societa" href="#">

<voice href="#">Storia</voice>

<voice href="#">Certificazioni</voice>

<voice href="#">Contatti</voice>

<voice href="#">Dove siamo</voice>

</item>

<item name="flotta" href="#">

<voice href="#">PZL M18B Dromader</voice>

<voice href="#">PZL 104-80 Wilga</voice>

</item>

</menu>

Thank you so much.

Attachments (0)
Change History (1)

Changed April 11, 2009 02:37PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

It looks like you are trying to parse XML with the

$("htmlstring")
method. That won't work in general, unless the XML is also valid HTML.

http://docs.jquery.com/Core/jQuery

If you need to parse XML, use an XML parser.

http://markmail.org/message/i2kytvrcn7cvdegn