【发布时间】:2018-01-05 09:35:06
【问题描述】:
如何在 sheetrock.js 中使用回调选项?我正在尝试将 sheetrock 的输出作为变量用作另一个函数的输入,但由于我的 JS 知识有限,因此遇到了困难。有什么帮助吗?
var d = new Date();
var month = new Array();
month[0] = "Jan";
month[1] = "Feb";
month[2] = "Mar";
month[3] = "Apr";
month[4] = "May";
month[5] = "Jun";
month[6] = "Jul";
month[7] = "Aug";
month[8] = "Sep";
month[9] = "Oct";
month[10] = "Nov";
month[11] = "Dec";
var n = month[d.getMonth()];
var y = d.getFullYear();
$("#value").sheetrock({
url: 'https://docs.google.com/spreadsheets/d/1XSVP75fJkq34gLHhwIsEWOC3My-6xnbVURk4U_wotD0/edit#gid=0',
query: "select C where B = "+ y +" and A = '"+ n +"'",
callback: draw
});
function draw(data, sheetrock,response) {
console.log(); // how to get the output from sheetrock as a variable?
}
【问题讨论】:
标签: javascript callback sheetrock