开发者

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

开发者 https://www.devze.com 2023-04-02 19:01 出处:网络
For this code: $(this).find(\"Name\") This is XML (element \"Name\"): <Win32_Processor> <AddressWidth>32</AddressWidth>

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

精彩评论

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