我无法选择<标题>使用 jQuery 在 Atom XML 中添加标签

发布于 2024-09-28 02:16:44 字数 259 浏览 0 评论 0原文

我使用 jQuery 通过 Ajax 获取 Atom 数据。

我写的

$(xhr).find('entry id').eq(0).html();

就OK了

$(xhr).find('entry title').eq(0).html();

无法选择任何东西。

标题标签实际上是存在的。

请帮忙。谢谢你!

I get Atom data through Ajax using jQuery.

I write

$(xhr).find('entry id').eq(0).html();

is OK.

But

$(xhr).find('entry title').eq(0).html();

can not select anything.

title tag is actually exist.

Please help. Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美胚控场 2024-10-05 02:16:44

这是因为 Atom XML 中没有 title 元素。如果 XML 命名空间 http://www.w3.org/2005/Atom 映射到命名空间前缀 atomatom:title代码>.

你的问题是 jQuery 是一个 HTML 库,而不是 XML 库。因此,它在处理真实的 XML 数据时存在一些缺点。

你需要的是一个插件。这篇 IBM Developerworks 文章 应该能让您了解我在说什么关于以及如何解决它。

That is because there is no title element in the Atom XML. The actual name is atom:title if the XML namespace http://www.w3.org/2005/Atom was mapped to the namespace prefix atom.

Your problem is that jQuery is a HTML library, not an XML library. Therefore, it has some shortcomings when it comes to handling real XML data.

What you need is a plugin. This IBM developerworks article should give you some idea what I'm talking about and how to solve it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文