Easiest way to wait for google server-side function to resolve
问题 I need the client side code to wait for the called server side (google.script.run) function to complete before running any more code. The withSuccessHandler(successFunc) does not cause lines of code that are after the server call to wait. What I've done: async function func(){ await google.script.run.withSuccessHandler(myFunc).serverFunc(); console.log("done"); } func(); How can the code wait to execute the console.log line until after the server side function resolves? 回答1: How about this