Google 脚本 app.createServerHandler 缺失;在语句第 8 行之前
Google Script app.createServerHandler Missing ; before statement line 8
我正在 Google 网站上制作休假申请表。如果我注释掉 app.createServerHandler 行就可以了。我从下面的代码中遗漏了什么?
var app = UiApp.createApplication().setTitle('OIT Leave Request');
//Create a panel to hold the form elements
var panel = app.createVerticalPanel().setId('panel');
//Create event handlers for form
var AllDayBoxHandler() = app.createServerHandler('AllDayBoxEvent');
勾选这个link。
我相信您尝试做的事情已经过时了。但无论哪种方式,我认为你设置的处理程序是错误的。类似于:
function doGet(e) {
var app = UiApp.createApplication().setTitle('OIT Leave Request');
//Create a panel to hold the form elements
var panel = app.createVerticalPanel().setId('panel');
app.add(panel);
//Create event handlers for form
var AllDayBoxHandler = app.createServerHandler('AllDayBoxEvent');
//Not exactly sure what events a panel can get
//A button would have a .addClickHandler method
panel.addOpenHandler(AllDayBoxHandler);
return app;
}
//The event handler method
function AllDayBoxEvent(e) {
// your code
}
我正在 Google 网站上制作休假申请表。如果我注释掉 app.createServerHandler 行就可以了。我从下面的代码中遗漏了什么?
var app = UiApp.createApplication().setTitle('OIT Leave Request');
//Create a panel to hold the form elements
var panel = app.createVerticalPanel().setId('panel');
//Create event handlers for form
var AllDayBoxHandler() = app.createServerHandler('AllDayBoxEvent');
勾选这个link。
我相信您尝试做的事情已经过时了。但无论哪种方式,我认为你设置的处理程序是错误的。类似于:
function doGet(e) {
var app = UiApp.createApplication().setTitle('OIT Leave Request');
//Create a panel to hold the form elements
var panel = app.createVerticalPanel().setId('panel');
app.add(panel);
//Create event handlers for form
var AllDayBoxHandler = app.createServerHandler('AllDayBoxEvent');
//Not exactly sure what events a panel can get
//A button would have a .addClickHandler method
panel.addOpenHandler(AllDayBoxHandler);
return app;
}
//The event handler method
function AllDayBoxEvent(e) {
// your code
}