ReferenceError: “document” is not defined

后端 未结 2 841
清歌不尽
清歌不尽 2021-01-23 05:43

Im new to JavaScript and even more new to Google Apps Script. Im trying a simple function that shows the current date (only day, month e and full year), but the Google Script sh

相关标签:
2条回答
  • 2021-01-23 06:17

    As said in the former answer you can't execute a function directly in the Browser, you'll have to choose a so called 'container' to run your function from it. I would recommand you read the documentation and maybe try a few simple tutorials to see how GAS can be executed.


    EDIT : following your comments, feel free to have a look at this script built with UiApp, the result is viewable here and shows what you wanted to : "Hello, today is 25/10/2012"

    0 讨论(0)
  • 2021-01-23 06:31

    Code running as a Google Apps Script does not run in the browser, so you cannot use web browser APIs with it. If you want to output content to a Google Site, then you need to use the API for Sites.

    Presumably you would want something like createWebPage and then use the methods on the resulting object to add the content to it.

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