I'm trying to make my first Google App. I have my HTML doc which has the include statement as outlined on HTML Service: Best Practices.
<html>
<head>
<base target="_top">
<?!= include('stylesheet') ?>
</head>
<body>
...
</body>
My code.gs file is as follows:
function doGet() {
return HtmlService.createTemplateFromFile('BooksTS2.html')
.evaluate();
}
My style sheet is named stylesheet.html, and for testing purposes is really simple:
<style>
p {color: green;}
</style>
But when I run it I get this error message: ReferenceError: "include" is not defined.
In the example they created the reusable function include(), you need to add it in your code.gs file:
You can always use the printing scriptlet directly in your html file like this: