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.
精彩评论