Traversing XML elements does not work in IE8
I am trying to traverse XML elements but it is not working in IE8. It is working just fine in Firefox though. And by not working I mean it doesn't go inside the loop even though there are elements.
This is the XML I am trying to traverse:
var $anXml = $('<node id="anID" inline="0" leaf="true">'
+'<sub_node1>Text \(more text\)</sub_node1>'
+'<sub_node2>Text \(more text\)</sub_node2>'
Here is the code I am using to traverse:
alert('children before loop: ' + $anXml.children.length);
var $aChild = $(this);
alert('children after loop: ' + $anXml.children.length);
Here is the output of alerts:
children before loop: 2
children after loop: 2
The 'child traversed!' is never displayed.
Any thoughts would be much appreciated.