Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 错误类型错误:无法读取属性';fn';未定义的用户点击次数 ;@财政司司长:8_Google Apps Script_Spreadsheet - Fatal编程技术网

Google apps script 错误类型错误:无法读取属性';fn';未定义的用户点击次数 ;@财政司司长:8

Google apps script 错误类型错误:无法读取属性';fn';未定义的用户点击次数 ;@财政司司长:8,google-apps-script,spreadsheet,Google Apps Script,Spreadsheet,我已经做了一个网络应用程序使用谷歌脚本连接到电子表格 在我尝试在用户提交表单信息时发送电子邮件通知的功能之前,一切都运行得很好 查看用户单击函数的运行日志时的错误代码- TypeError:无法读取未定义userClicked@funcs的属性“fn”。gs:8 函数js页面如下 'function userClicked(userInfo) { var ss = SpreadsheetApp.openByUrl(url1); var ws = ss.getSheetByName(&

我已经做了一个网络应用程序使用谷歌脚本连接到电子表格

在我尝试在用户提交表单信息时发送电子邮件通知的功能之前,一切都运行得很好

查看用户单击函数的运行日志时的错误代码- TypeError:无法读取未定义userClicked@funcs的属性“fn”。gs:8

函数js页面如下

  'function userClicked(userInfo) {
  var ss = SpreadsheetApp.openByUrl(url1);
  var ws = ss.getSheetByName("SNAGS");
  ws.appendRow([userInfo.fn, 
                userInfo.contact,
                userInfo.email,
                userInfo.house,
                userInfo.snag, 
                userInfo.query,
                new Date()]);

document.addEventListener('DOMContentLoaded',function()
{
document.getElementById(“btn”)。addEventListener(“单击”,doStuff);
文件.getElementById(“house”).addEventListener(“输入”,getInfo);
var-selectbox=document.querySelectorAll('select');
M.FormSelect.init(选择框);
google.script.run.withSuccessHandler(populateHouse.getHouse();
}
); 
功能人群之家(hous)
{
var autocomplete=document.getElementById('house');
var instances=M.Autocomplete.init(Autocomplete,{data:hous});
}
函数doStuff()
{
var isValid=document.getElementById(“fn”).checkValidity();
如果(!isValid)
{
M.toast({html:'Name Required!'});
}
其他的
{
addRecord();
}
}
函数addRecord()
{
var userInfo={};
userInfo.fn=document.getElementById(“fn”).value;
userInfo.contact=document.getElementById(“contact”).value;
userInfo.email=document.getElementById(“电子邮件”).value;
userInfo.house=document.getElementById(“house”).value;
userInfo.snag=document.getElementById(“snag”).value;
userInfo.query=document.getElementById(“查询”).value;
google.script.run.userClicked(userInfo);
document.getElementById(“fn”).value=“”;
document.getElementById(“联系人”).value=“”;
document.getElementById(“电子邮件”).value=“”;
文件.getElementById(“房屋”).value=“”;
document.getElementById(“snag”).value=“”;
document.getElementById(“查询”).value=“”;
M.updateTextFields();
var myApp=document.getElementById(“障碍”);
myApp.selectedIindex=0;
M.FormSelect.init(myApp);
}
函数getInfo()
{
var HouseInfo=document.getElementById(“house”).value;
如果(HouseInfo.length==3)
{
google.script.run.withSuccessHandler(updateInfo.getData(HouseInfo));
}
}
函数更新信息(infos)
{
document.getElementById(“info”).value=infos;
M.updateTextFields();
}

TPM维护|票务系统

你的名字: 您的电话号码: 电邮: 家 位置区域/房屋单元 障碍类别 障碍型 单位信息 查询说明: 送票! 发送
//html部分
如果您正在运行教程视频中的步骤,则尝试运行
userClicked()
函数来授权Gmail API。由于应用程序脚本认为它是一个独立的函数,
userInfo
被认为是未定义的。这是预期的行为

视频摘录: