title: Function given with google.script.run not getting invoked
body: <p>I have followed code snippets and directions given at <a href="https://developers.google.com/apps-script/guides/html/communication#index.html" rel="nofollow noreferrer">https://developers.google.com/apps-script/guides/html/communication#index.html</a></p>
  
  <p>And added following codes in my scripts project:</p>
  
  <p>Code.gs</p>
  
  <pre><code>function doGet() {
    return HtmlService.createHtmlOutputFromFile('Index');
  }
  
  
  function doSomething() {
    Logger.log('I was called!');
  }
  </code></pre>
  
  <p>Index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
      &lt;script&gt;
  
  google.script.run.doSomething();
  
  &lt;/script&gt;
  
    &lt;/head&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>But my function <code>doSomething</code> is not getting called. This is a fresh google scripts project that I have started and published it as web app.</p>
  
  <p>I have seen similar issue reported in <a href="https://stackoverflow.com/questions/46717644/how-to-use-google-script-run">this</a> thread and <a href="https://stackoverflow.com/questions/56844507/google-sheets-class-google-script-run-not-working">this</a> 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.</p>
  
  <p>Thanks,
  Mukesh</p>