var artist = 'Marina & the Diamonds';
var infourl = 'http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist='+artist+'&api_key=xxx&format=json&callback=?';
这是我的 javascript 代码,我使用 infourl 进行 getJson 查询。但正如您所见,艺术家变量有一个&
字符,并且 last.fm api 返回名为 Marina 的艺术家,而不是 Marina & the Diamonds。同时,网址似乎很好:
Request URL:http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Marina%20&%20the%20Diamonds&api_key=xxx&format=json&callback=jsonp1301591978245
任何的想法?谢谢