我目前使用的是谷歌脚本,但我在使用doPost(e)
时遇到了问题,每次我向脚本发送POST请求时,都会遇到变量e未定义的问题
我的代码:
function doPost(e){
var company = JSON.parse(e.postData.contents)['meta']['company_id'];
var s = SpreadsheetApp.openById('1lEp4Ul0D3eGsIEbjS6rFhjVVVjH6v5ZJvxRfGr5WLWQ');
var ss = s.getSheetByName('Hoja 1');
var token = 'hidden secret token';
// get previous and current data from post
var previous = JSON.parse(e.postData.contents)['previous'];
//set the previous stage id to current object
current['previous_stage_id'] = previous['stage_id'];}
帖子回复都是原始的正文。
发布于 2016-03-28 01:15:15
如果此信息会导致在脚本端发生某些事情,则需要添加一个
google.script.run.functionName(responseValues)
到HTML。如果HTML需要返回值,则添加一个处理程序。
google.script.run.withSuccessHandler(doSomething).functionName()
doSomething是页面上的JS,functionName是一个谷歌脚本函数。
https://stackoverflow.com/questions/35465458
复制相似问题