I'm building a user interface in HTML Service for Google Apps Script and I want to be able to call functions from a library that is loaded in the server side .gs file of my script. The client side call to the server side library does not seem to work. Is this possible to do?

I'm pretty new to javascript/apps script so excuse me if I'm mis-stating what's happening here.

UPDATE: Here's the solution I used

On the container bound script:

function libraryHandler(functionName){
  return eval("libraryIdentifier." + functionName);
}

In the library:

google.script.run.libraryHandler('myLibraryFunctionName(param1,param2,etc.)')
有帮助吗?

解决方案

Make a "dummy" function in the same script where the html is. Make that dummy call your library function.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top