【发布时间】:2013-01-04 14:56:50
【问题描述】:
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script>
$.getJSON('http://game4u.comuf.com/songs.json', function(data) {
var output = data.music[0].url;
document.getElementById("placeholder").innerHTML = output;
});
</script>
但是当我运行它时,我的 JSON 文件 ( music[0].url ) 没有显示在浏览器中。我在本地运行 HTML,而不是在与网站相同的服务器上。
【问题讨论】:
-
我们的 JSON 无效,里面有字符需要转义,为什么你的 url 中有 `\`?
-
你能帮忙吗?我是这个 JSON 的新手 :)
标签: javascript json