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.
以前$.getJSON()はjson APIからデータを取得していました。プレーン オブジェクトを返します。次のようなオブジェクトから特定の値を取得しようとしました: data.topartists.artist[0].image[4].#text. これにより、 が原因で が発生Uncaught SyntaxError: Unexpected token ILLEGALし#ます。#キーから値を取得できるようにエスケープする方法はあります#textか?
$.getJSON()
data.topartists.artist[0].image[4].#text
Uncaught SyntaxError: Unexpected token ILLEGAL
#
#text
ブラケット表記を使用する必要があります
data.topartists.artist[0].image[4]['#text']