简体   繁体   English

如何将表单数据发布到Google Apps脚本

[英]How to post form data to Google Apps Script

What is the best/easiest way to post form data from my HTML page to my GAS script? 将表单数据从HTML页面发布到GAS脚本的最佳/最简便方法是什么?

$(document).ready(function() {
  $.getJSON(SCRIPT_URL+"?callback=?", { method:"addRow"}, function (data) { alert(JSON.stringify(data)); }); 
});

If you are using Apps Script HTML Service, you can use google.script.run . 如果您使用的是Apps Script HTML Service,则可以使用google.script.run

Google Documentation - Client-side API - call server-side Apps Script functions Google文档-客户端API-调用服务器端Apps脚本函数

From a app or site outside of Google, make an HTTP Request to the Apps Script URL. 在Google以外的应用或网站上,向“应用脚本网址”发出HTTP请求。

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

相关问题 "如何在谷歌应用脚​​本函数中使用模态表单数据?" - How to use the modal form data in the google apps script functions? 如何使用HTML和Google Apps脚本发送表单 - How To Send Form With HTML and Google Apps Script 使用 Google Apps 脚本编辑以前提交的表单时如何从表单条目中收集数据? - How to collect data from form entries when editing a previously submitted form using Google Apps Script? 如何将数据从 Puppeteer 发布到 Google Apps 脚本 web 应用 API 端点 node.js 中? - How to POST data from Puppeteer to Google Apps Script web app API endpoint in node.js? Google Apps Script - 如何登录和获取数据? - Google Apps Script - how to login and fetch data? 如何将数据批量添加到 Google Apps 脚本 - How to add data to a Google Apps script in batches 如何使用Google Apps脚本为Google表单中的项目设置父项? - How to set the parent for item in a google form using google apps script? 在 Google Apps 脚本中,如何通过重新加载 doPost() 返回的 HTML 来防止多次提交表单数据? - In Google Apps Script, How to prevent multiple submission of form data by reloading the HTML returned by doPost()? Google Apps 脚本 HTML 表单 - Google Apps Script HTML Form Google Apps 脚本 JQuery 表单 - Google Apps Script JQuery Form
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM