문제

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