开发者

How to traverse xml through jquery?

I am trying to traverse a rss feed in w开发者_高级运维hich a tag is present like below

<item>
<itunes:explicit>​no​</itunes:explicit>​
</item>

how do i get the value of itunes:explicit. i tried like below

_this = loadedData // xml data from the ajax request
$(_this).find('item').find('itunes:explicit').text()

It is not returning the text present in it.

Any way to access this ?


You need to escape the colon in your selector so that jQuery doesn't interpret the colon as a CSS pseudo-class:

$(_this).find('itunes\\:explicit').text()


user parseXML, described here.


you can directly find the thing which you want..you don't need heirarchy for that..try with this code-

$(_this).find('itunes\\:explicit').text()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜