I have followed code snippets and directions given at https://developers.google.com/apps-script/guides/html/communication#index.html
And added following codes in my scripts project:
Code.gs
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
function doSomething() {
Logger.log('I was called!');
}
Index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
google.script.run.doSomething();
</script>
</head>
</html>
But my function doSomething
is not getting called. This is a fresh google scripts project that I have started and published it as web app.
I have seen similar issue reported in this thread and this thread. I have tried the measures mentioned there, but still facing the issue. Also, I see that there is no accepted answer there, so posting this question again. I don't know how to bring those questions back to life.
Thanks, Mukesh