How to use google.script.run?

前端 未结 2 1739
余生分开走
余生分开走 2021-01-22 08:32

I am trying to use the google.run.script function in one of my projects and it doesn\'t seem to be triggering the function to run.

So I made a new project and tested a

相关标签:
2条回答
  • 2021-01-22 08:46

    I just copied your code and it is working for me. It seems that you have other code in your project which might have some errors.

    Otherwise, you might be using URL of old version of your deployed project.

    Deployment procedure is available here. https://developers.google.com/apps-script/guides/web

    0 讨论(0)
  • 2021-01-22 08:47

    I think that your script works fine. doSomething() is run by google.script.run.doSomething(), and you can see I was called! at the log. So please confirm the following flow.

    1. About deploying Web Apps. Even if doGet() is directly run on script editor, it doesn't work. At that time, please deploy as Web Apps. You can see the detail of how to deploy Web Apps is here.
    2. After the script is modified, project version has to be updated. By this, the latest script can be used by Web Apps. If you don't want to update the project version, you can use the latest script by clicking latest code of Test web app for your latest code.. This can be seen below.
      • On script editor
      • Publish -> Deploy as web app
      • You can see "Test web app for your latest code." at "Current web app URL:"

    If this was not useful for you, I'm sorry.

    0 讨论(0)
提交回复
热议问题