Printing to the console in Google Apps Script?

前端 未结 7 825
迷失自我
迷失自我 2021-01-31 01:13

I am very new to programming (have taken some of the JS courses on Codecademy). I am trying to create a simple script to determine, if given a spreadsheet with results from a po

7条回答
  •  梦如初夏
    2021-01-31 01:44

    In a google script project you can create html files (example: index.html) or gs files (example:code.gs). The .gs files are executed on the server and you can use Logger.log as @Peter Herrman describes. However if the function is created in a .html file it is being executed on the user's browser and you can use console.log. The Chrome browser console can be viewed by Ctrl Shift J on Windows/Linux or Cmd Opt J on Mac

    If you want to use Logger.log on an html file you can use a scriptlet to call the Logger.log function from the html file. To do so you would insert replacing something with whatever you want to log. Standard scriptlets, which use the syntax , execute code without explicitly outputting content to the page.

提交回复
热议问题