0

I want to have a static page (HTML/CSS/JavaScript (jQuery)) that fires an Ajax request to Google Apps Script so that it can return a list of Google Docs, then the JavaScript can display that its, have the user select a document and fire another Ajax request to get the content of the document. The JS is going to be specific to the page and I will write it myself, but I need to know if Google Apps Script can be always open to receive these HTTP requests. It looks like I have to have a trigger, meaning it can't always be available. Is there any way to have Google Apps Script always be available to receive and respond to HTTP requests?

2 Answers2

1

You can do a GET request to a published script using the content service parameters.

https://developers.google.com/apps-script/guides/content

AshClarke
  • 2,990
  • 5
  • 21
  • 27
-1

It can receive POST and GET requests, you gotta use a doGet() or doPost() to get its parameters. Check this documentation out

If you have problems with Ajax requests check my answer here.

Community
  • 1
  • 1
Maycow Moura
  • 6,471
  • 2
  • 22
  • 19