简体   繁体   English

GAS服务器处理程序,有什么区别?

[英]GAS serverhandlers, what's the difference?

What's the difference among 之间有什么区别

.createServerHandler, .createServerClickHandler, .createClickHandler .createServerHandler,.createServerClickHandler,.createClickHandler

?

Thanks 谢谢

referring to the doc method createServerClickHandler(functionName) - deprecated 2012-03-06 引用doc 方法createServerClickHandler(functionName)-不建议使用2012-03-06

in favor of createServerHandler which creates the 'generic' server handler in the Uiinstance. 支持createServerHandler,它在Uiinstance中创建“通用”服务器处理程序。 The createClickHandler is one of many methods that defines the behavior of the handler : click/change/mouse/key... (see doc of the element you use) and the possible options will be different depending of the type of element. createClickHandler是定义处理程序行为的多种方法之一:click / change / mouse / key ...(请参阅所用元素的文档),根据元素类型的不同,可能的选项也会有所不同。

Note that the autocomplete feature allows to see easily what handlers are available for each Ui element. 请注意,自动完成功能允许您轻松查看每个Ui元素可用的处理程序。

Also important to remember, a server side handler sends your request to the server to perform the and then sends the request response back to your application, which can have some latency. 记住同样重要的一点是,服务器端处理程序将您的请求发送到服务器以执行,然后将请求响应发送回您的应用程序,这可能会有一些延迟。

If you have a task like disabling a button immediately after it is pressed, you can use a client handler which performs the operation inside the browser and doesn't have the latency that a server handler would have. 如果您有像在按下按钮后立即禁用按钮之类的任务,则可以使用客户端处理程序,该客户端处理程序在浏览器内部执行操作,并且没有服务器处理程序所具有的延迟。

More info: Handlers in general https://developers.google.com/apps-script/guide_user_interfaces#UIUpdate 更多信息:一般的处理程序https://developers.google.com/apps-script/guide_user_interfaces#UIUpdate

Client handlers https://developers.google.com/apps-script/guide_user_interfaces#ClientHandlers 客户端处理程序https://developers.google.com/apps-script/guide_user_interfaces#ClientHandlers

Hope that helps, 希望能有所帮助,

Ryan 瑞安

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM