【问题标题】:Google Apps "Unknown macro doGet"Google Apps“未知宏 doGet”
【发布时间】:2012-08-08 00:08:15
【问题描述】:

每次从https://developers.google.com/apps-script/html_service 部署“将数据提取到模板”中的练习时,我都会收到消息“未知宏 doGet”

本练习中没有函数(宏)doGet。之前的练习中有“将数据拉入模板”

这个练习的功能是:

函数 getData() { return SpreadsheetApp.openById('fileID').getRangeByName('dataRange').getValues(); }

但每次我部署它都会显示“Unknown Macro doGet”

为什么这个脚本仍然在另一个脚本中回顾之前的 doGet?我怎样才能解决这个问题?谢谢。

【问题讨论】:

    标签: templates google-apps-script


    【解决方案1】:

    这不是一个完整的示例脚本。这只是对之前脚本的一个点缀。您仍然需要在每个 HtmlService 应用程序中使用 doGet,并且上一个示例中的那个应该是您在此处使用的脚本的一部分。

    【讨论】:

      【解决方案2】:

      感谢 Cory G。所以您还必须有一个包含此代码的 .gs。

      function doGet() {
          return HtmlService.createTemplateFromFile('myTemplate').evaluate();
      }
      

      【讨论】:

        猜你喜欢
        • 2012-07-14
        • 2020-10-31
        • 1970-01-01
        • 2016-12-14
        • 2015-05-29
        • 1970-01-01
        • 2021-05-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多