Skip to content
Advertisement

How to set a tag text value from Google Apps Script with JavaScript?

How are the elements foo and bar set to the values for their corresponding variables?

html:

JavaScript

code:

JavaScript

Server side logs show foo and bar values when uncommented. However, there seems no output from console.log("some text"); from within the function defined on the HTML page.

Advertisement

Answer

If you are trying to get the response of the google script function, then you will have to call that with success handler. google.script.run.getBar() should be updated as:

JavaScript

You can use this value to assign to the div or perform some other operations.

Advertisement