在json中获取谷歌电子表格给出404未找到

时间:2014-08-02 02:33:44

标签: javascript jquery json google-docs-api google-spreadsheet-api

我在互联网上尝试了所有可能的方式来获取我的谷歌电子表格作为json

$.getJSON()

但我一直在找404找不到。在发布到网络时,我得到这个网址:https://docs.google.com/spreadsheets/d/1vho9BS2YdCz3aKuLyV9m15stYhBu4G97ngzRasQsG1Y/pubhtml

要获取json,我已经厌倦了这个

中所有url的组合
url = "https://docs.google.com/spreadsheets/d/1vho9BS2YdCz3aKuLyV9m15stYhBu4G97ngzRasQsG1Y/od6/public/values?alt=json&callback=?";
$.getJSON(url, function(resp) {
    console.log(resp)
});

不确定还能做什么。似乎od6 / public / value格式对我不起作用。此外,在"发布到网络",谷歌似乎已删除了单元格和列表选项。

解决方案: 我决定使用https://github.com/chriszarate/sheetrock。做得很棒!

1 个答案:

答案 0 :(得分:0)

您尝试访问的网址未返回JSON。 它返回HTML,因此JQ函数不知道如何处理它接收的数据。