这是我的代码:
var sheets = google.sheets('v4');
sheets.spreadsheets.values.update(
{
auth: auth,
spreadsheetId: '1tsyo5XFh1CzlF6Xd_q1ciUQY9KDo_rWYGdrwlANBduc',
range: 'Sheet1!A1:D5',
values: [
["Item", "Cost", "Stocked", "Ship Date"],
["Wheel", "$20.50", "4", "3/1/2016"],
["Door", "$15", "2", "3/15/2016"],
["Engine", "$100", "1", "30/20/2016"],
["Totals", "=SUM(B2:B4)", "=SUM(C2:C4)", "=MAX(D2:D4)"]
],
},
function (err, response) {
if (err) {
console.log(err);
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
}
console.log(response);
});
Run Code Online (Sandbox Code Playgroud)
我是通过Google Doc的例子来做这件事的
但是我收到了错误:
{[错误:收到无效的JSON有效负载.未知名称"值":无法绑定查询参数.在请求消息中找不到字段'值'.]代码:400,错误:
[ { message: 'Invalid JSON payload received. Unknown name "values": Cannot bind query parameter. Field \'values\' could not be found …Run Code Online (Sandbox Code Playgroud) logcat给了我这个错误:
ActivityManager
Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity } from ProcessRecord{b5506878 1527:com.android.launcher/u0a10002} (pid=1527, uid=10002) requires android.permission.INTERNET
Launcher
Launcher does not have the permission to launch Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity }. Make sure to create a MAIN intent-filter for the corresponding activity or use the exported attribute for this activity. tag=ApplicationInfo(title=ZavrsniApp) intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity }
Launcher
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=zavrsni.android.app/.MainActivity } from ProcessRecord{b5506878 1527:com.android.launcher/u0a10002} (pid=1527, uid=10002) requires …Run Code Online (Sandbox Code Playgroud) 对不起,如果这个问题之前得到了回答,但我找不到.
我有一个对象数组,对于每个对象,我想做一个异步调用(ajax调用),当所有异步调用完成后,我想调用另一个函数.
例如.
var list = [Object, Object, Object, Object];
var final= [];
$(list).each(function(){
//ajax call
getSomething(data, function(data){
final.push(data);
});
});
Run Code Online (Sandbox Code Playgroud)
在完成所有ajax调用后,我想调用函数 load(final);
这可以用回调来完成,没有像when.js等库.
钍.