I am creating a web app to communicate with a spreadsheet. The problem is, from the HTML file, I am calling on functions from the .gs file with my doGet() and a function called doSomething(). When I call on doSomething twice, it only executes once.
My HTML file (called lolcatz.html)
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<script>
google.script.run.doSomething();
google.script.run.doSomething2();
google.script.run.doSomething();
console.log("Hi");
</script>
</body>
</html>
My Google App script file (called Code.gs):
function doGet() {
var page = HtmlService.createHtmlOutputFromFile('lolcatz.html');
page.setTitle("Panther Time");
return page;
}
function doSomething() {
Logger.log('I was called!');
}
function doSomething2() {
Logger.log('I was called! Again!');
}
function doStuff() {
doSomething();
doSomething2();
}
The log output:
[18-03-28 14:55:00:032 PDT] I was called!
The console.log command executes fine when I go to Inspect Element's JavaScript console.
I am well inside the execution limit and have the Google App Script API and the Google Sheets API enabled.