我们已经将Tabletop用于几个项目,作为从Google获取少量数据的简单方法。
下面是来自Tabletop.js Github的示例代码
function init() {
Tabletop.init( { key: 'https://docs.google.com/spreadsheets/d/0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE/pubhtml',
callback: function(data, tabletop) {
console.log(data)
},
simpleSheet: true } )
}
window.addEventListener('DOMContentLoaded', init)下面是我的示例数据源:https://docs.google.com/spreadsheets/d/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/pubhtml
但是当我尝试执行这个测试代码时:https://jsfiddle.net/BaronGrivet/oqnx2sjc/
<div id="data">
<strong>Data should appear here: </strong>
</div>
function init() {
Tabletop.init( {
key: 'https://docs.google.com/spreadsheets/d/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/pubhtml',
callback: function(data, tabletop) {
console.log(data)
document.getElementById('data').innerHTML += data
},
simpleSheet: true } )
}
init()控制台中出现以下错误:
加载资源失败:服务器响应状态为500 () https://spreadsheets.google.com/feeds/worksheets/1atRxZ4IgQPo5z5-DV7okHdtml8e3VdPjpuiEhwvU8FI/public/basic?alt=json
我意识到这意味着谷歌身边有一个错误--但我不知道这是一个会被修正的错误,还是一个服务的永久改变,要么需要改变Tabletop,要么已经完全停止了访问JSON的选择。
有没有其他人遇到过这个问题,并找到了解决办法?
发布于 2019-04-30 08:46:57
在https://issuetracker.google.com/issues/131613284上最好遵循谷歌的问题路线
https://stackoverflow.com/questions/55911904
复制相似问题