0

Is it possible to put normal Javascript in a Google Apps Script file? I know it follows JS syntax but can I use the output of a JS function in a Google function? I'm new to this and I don't know the limitations.

1
  • Also, how can I add the jQuery and Angular libraries to work with my script? Commented Mar 14, 2015 at 18:05

1 Answer 1

1

In HTML served by Apps Script you can use DOM interfaces like the Document object and the getElementById() method of the Document object. getElementById You can also use jQuery. See --> Best Practices

Apps Script uses JavaScript as it's server side language. You can't use the DOM or jQuery in server side code.

With the new html iframe mode, you can use angularJs in HTML (client side).

There are JavaScript restrictions in the HTML Service: https://developers.google.com/apps-script/guides/html/restrictions#javascript

For server side code, most any JavaScript method/property can be used. For dates in server side .gs scripts, you can use the Apps Script formatDate() method of the Utilities Service.

Use the Cache Service for storing data to pass between functions in server side JavaScript, rather than looking up the same data multiple times.

Sign up to request clarification or add additional context in comments.

1 Comment

You can use angular and such with the new html iframe mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.