简体   繁体   English

没有页面刷新的Google Apps脚本HTML表单

[英]Google Apps Script Html Form Without Page Refresh

Currently, I am changing an app that I had built for my organization from UiService to HtmlService. 目前,我正在将为组织创建的应用程序从UiService更改为HtmlService。 This part isn't the hard part. 这部分不是困难的部分。

However, in the past iteration of the app, submitting the form obviously creates a refresh(?) or at least an elimination of the form from visibility. 但是,在应用程序的过去迭代中,提交表单显然会创建refresh(?),或者至少从可见性中消除了表单。 This was one of the biggest complaints for this app in particular for users who need to put in multiple entries at a time. 这是该应用程序最大的抱怨之一,特别是对于那些需要一次输入多个条目的用户而言。

For my other apps, it was as simple as replacing the submit button with an onClick function. 对于我的其他应用程序,这就像用onClick函数替换提交按钮一样简单。 However, because this app Requires an attachment, I haven't found a way to have the form submit without refreshing the page. 但是,由于此应用程序需要附件,因此我没有找到一种无需刷新页面即可提交表单的方法。 I have tried returning false; 我试图返回假; and other methods proposed for normal HTML/JavaScript based pages. 以及其他针对基于HTML / JavaScript的常规网页建议的方法。

Is this a limitation with Google Apps Script HtmlService because of the Caja Sanitation or the iframe Sandbox? 由于Caja Sanitation或iframe沙箱,Google Apps Script HtmlService是否受到限制?

So after doing some research, the answer was right under my nose. 因此,在进行了一些研究之后,答案就在我的鼻子底下。 It was on Googles Best Practice for HtmlService. 这是针对HtmlService的Google最佳做法。

Sorry for posting an unnecessary question. 很抱歉张贴不必要的问题。

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

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