Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 谷歌网站中的应用程序脚本表单没有响应_Google Apps Script_Google Sites - Fatal编程技术网

Google apps script 谷歌网站中的应用程序脚本表单没有响应

Google apps script 谷歌网站中的应用程序脚本表单没有响应,google-apps-script,google-sites,Google Apps Script,Google Sites,以下应用程序脚本使用Html服务,其行为符合预期,并在单击“提交”按钮后显示响应页面 问题:如果应用程序脚本包含在谷歌网站中(通过插入>应用程序脚本小工具),并且表单已提交,则响应页面不会显示–也不会显示错误消息 代码.gs function doGet() { return HtmlService.createTemplateFromFile('myForm').evaluate(); } function doPost() { return HtmlService.createTe

以下应用程序脚本使用Html服务,其行为符合预期,并在单击“提交”按钮后显示响应页面

问题:如果应用程序脚本包含在谷歌网站中(通过插入>应用程序脚本小工具),并且表单已提交,则响应页面不会显示–也不会显示错误消息

代码.gs

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

function doPost() {
  return HtmlService.createTemplateFromFile('myResponse').evaluate();
}
myForm.html

<html>
<body>
<form action="https://script.google.com/a/macros/.../exec" method="post">
<input type="submit" value="Submit">
</form>
</body>
</html>
<html>
<body>
<h3>Hello World!</h3>
</body>
</html>

myResponse.html

<html>
<body>
<form action="https://script.google.com/a/macros/.../exec" method="post">
<input type="submit" value="Submit">
</form>
</body>
</html>
<html>
<body>
<h3>Hello World!</h3>
</body>
</html>

你好,世界!

我能够重现这个问题。这是因为我们的问题跟踪程序中有一个问题跟踪程序,它仍然在加载非sites.google.com地址。这是由于帧级URL加载的安全限制造成的

解决方法是将myForm.html改为指向sites.google.com/a/macros,而不是script.google.com/a/macros。我确认这对一个公共消费者帐户和一个谷歌应用程序企业帐户都有效

<html>
<body>
<form action="https://sites.google.com/a/macros/.../exec" method="post">
<input type="submit" value="Submit">
</form>
</body>
</html>