使用jQuery从XML中提取第一个子项
要查找第一个子项的jQuery遍历,我需要每行的第一个数据节点,o/p 111使用jQuery从XML中提取第一个子项,jquery,xml,Jquery,Xml,要查找第一个子项的jQuery遍历,我需要每行的第一个数据节点,o/p 111 <Row ss:AutoFitHeight="0"> <Cell> <Data ss:Type="Number">1</Data> </Cell> <Cell> <Data ss:Type="Number">2</Data> </Cell&g
<Row ss:AutoFitHeight="0">
<Cell>
<Data ss:Type="Number">1</Data>
</Cell>
<Cell>
<Data ss:Type="Number">2</Data>
</Cell>
<Cell>
<Data ss:Type="Number">3</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0">
<Cell>
<Data ss:Type="Number">1</Data>
</Cell>
<Cell>
<Data ss:Type="Number">2</Data>
</Cell>
<Cell>
<Data ss:Type="Number">3</Data>
</Cell>
</Row>
<Row ss:AutoFitHeight="0">
<Cell>
<Data ss:Type="Number">1</Data>
</Cell>
<Cell>
<Data ss:Type="Number">2</Data>
</Cell>
<Cell>
<Data ss:Type="Number">3</Data>
</Cell>
</Row>
$(xml).find("Data").each(function(index){
//if (index%2!=0)
{
data.push($(this).eq(1).text().toLowerCase().trim());
}
});
$('Row Cell Data:nth-child(1)').each(function(){
alert($(this).text());
});