Google apps script google.script.run.myFunction和<;之间的差异;?myFunction()&燃气轮机;

Google apps script google.script.run.myFunction和<;之间的差异;?myFunction()&燃气轮机;,google-apps-script,Google Apps Script,我对GAS非常陌生,在googleapps脚本项目中的html文件中,我不太清楚这两者之间的区别 index.html google.script.run.myFunction(); <? myFunction(); ?> google.script.run.myFunction(); 这两个函数都运行.gs文件中的函数,对吗?有什么区别吗?谢谢第一个将运行.gs文件中的服务器端脚本,第二个将运行.html文件中的函数,但不会运行该项目中.gs中的某些内容。这两个函数都调用服务

我对GAS非常陌生,在googleapps脚本项目中的html文件中,我不太清楚这两者之间的区别

index.html

google.script.run.myFunction();

<? myFunction(); ?>
google.script.run.myFunction();

这两个函数都运行.gs文件中的函数,对吗?有什么区别吗?谢谢

第一个将运行
.gs
文件中的服务器端脚本,第二个将运行
.html
文件中的函数,但不会运行该项目中
.gs
中的某些内容。这两个函数都调用服务器端函数,但scriplets仅在构建HTML模板时运行

澄清:

google.script.run.myFunction();
在提供侧边栏/对话框后调用服务器端函数

<? myFunction(); ?>

在提供HTML模板之前构建HTML模板时调用服务器端函数