Getting HTMLUnknownElement with jQuery.find() and an XML Document
- by Tom
I'm attempting to load up an XML document (specifically an RSS feed) via an Ajax request, parse it, and insert some information based on said feed into my page. The code works fine in Firefox, Opera, Chrome, and Safari, but not IE7. Go figure.
After doing some initial debugging, I've found that the XML string is being retrieved via the request, and the specific node type I'm getting when trying to parse nodes out of the document is HTMLUnknownElement.
Here's the relevant code:
$.get('feed.php', function(oXmlDoc) {
var titles = $(oXmlDoc).find('title');
var dates = $(oXmlDoc).find('pubDate');
for(var i = 0; i < 5; i++) {
parseNodes(titles[i].firstChild.nodeValue, dates[i].firstChild.nodeValue));
}
});
The parseNodes function is never actually being hit because IE cannot access firstChild and, consequently, nodeValue.
Thanks in advance for any ideas and/or suggestions on how to address this.