开发者

JQuery: How to parsing XML to know whether there is an element within the text?

For this code:

$(this).find("Name")

This is XML (element "Name"):

  <Win32_Processor>
    <AddressWidth>32</AddressWidth>
    <L2CacheSize>256</L2CacheSize>
    <L2CacheSpeed>600</L2CacheSpeed>
    <LastErrorCode/>
    <Level>6</Level>
    <LoadPercentage>1</LoadPercentage>
    <Manufacturer>GenuineIntel</Manufacturer>
    <MaxClockSpeed>598</MaxClockSpeed>开发者_Go百科
    <Name></Name>
    <VoltageCaps/>
  </Win32_Processor>


Check the length property of the above; if it is > 0, then at least one element was found.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜