【发布时间】:2019-11-12 15:09:54
【问题描述】:
我的问题很简单。我在网上搜索的所有可能的解决方案都没有解决我的问题。
Google 的类 google.script.run (https://developers.google.com/apps-script/guides/html/reference/run#withSuccessHandler) 的开发者网站展示了方法 myFunction(...)(任何服务器端函数)。
我已经复制了他们的确切代码和html代码,并推断出函数doSomething()没有执行。没有任何记录。
我打算用它来执行一个 HTML 文件,这样我就可以播放一个声音文件。到目前为止,我可以通过从侧面弹出一个侧边栏来做到这一点,如该线程中所述:Google Script: Play Sound when a specific cell change the Value。
但是,Google 提供的这段代码不起作用。为什么?
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
function doSomething() {
Logger.log('I was called!');
}
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
google.script.run.doSomething();
</script>
</head>
<body>
</body>
</html>
【问题讨论】:
标签: html google-apps-script google-sheets editor execute