DEV Community

Mauro
Mauro

Posted on

Answer: Add internal javascript and style file to a Google Apps Script

To add your JavaScript code to the Google Apps Script project create a HTML file as is instructed in the best practices doc from Google. Example taken from the referred page:

Code.gs

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

function include(filename) {
  return HtmlService.createHtmlOutputFromFile(filename)
      .getContent();
}

Page.html

<!DOCTYPE html>
<html>

Top comments (0)