Reputation: 11
I have Google app script application and the file script.html
is included in index.html
using the function below, and it works fine. However, script.html
has a script tag, which prevents searching through function definitions, I want to include script.html
in index.html
without having script tag in script.html
file.
The include function:
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename).getContent();
}
Upvotes: 1
Views: 93
Reputation: 8606
Simply put the script tabs in the html page.
HTML_Test
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<input id="test" type="button" value="Click Me" onclick="testOnClick()">
<script>
<?!= include("JS_Test"); ?>
</script>
</body>
</html>
JS_Test
function testOnClick() {
alert("Hello");
}
Upvotes: 0