Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Last.fm 似乎#在其 JSON API 的一些变量名前放置了符号。在此处查看示例响应。一旦我尝试#text使用 JavaScript 访问,我就会在控制台中收到无效符号错误。这个散列的任何快速修复或原因?
#
#text
jQuery 仅用于检索数据。访问#text数据是通过直接的 JavaScript 语法完成的,比如data.recenttracks.track.artist["#text"]
data.recenttracks.track.artist["#text"]
您不能这样做artist.#text,因为#用于访问对象成员的首字符符号无效。请改用方括号。
artist.#text