2012-01-31 94 views
0

我尝试做一个XMLHttpRequest到:http://lyricwiki.org/api.php?artist=" + encodeURIComponent(artistName) + "&song=" + encodeURIComponent(songName) + "&fmt=xmlSpotify的XML请求

拿到歌词 但是当我看在检查Spotify的请求状态是0 我能做些什么?

回答

1

你的代码更完整的帖子将有所帮助。但是我会用最简单的测试例子给出这个镜头。

需要这个权限在你manifest.json

"RequiredPermissions": [ 
    "http://lyricwiki.org" 
], 

重要:确保manifest.json文件是utf-8使用正确的\n只换行编码,并使用JSON棉短绒,以验证它是否很好格式化( http://jsonlint.com/) 此外,请确保在对manifest.json进行任何更改后重新启动Spotify客户端。

这个简单的例子为我工作:

$.post("http://lyricwiki.org/api.php" + 
      "?artist=" + encodeURIComponent("Beastie Boys") + 
      "&song=" + encodeURIComponent("Make Some Noise") + 
      "&fmt=xml", function (data) { 
     alert("Data loaded: " + data); 
    });