I've been looking at this "example" in the GAS documentation, but there is no explanation accompanying it from the googlers documenting it:
https://developers.google.com/apps-script/guides/html-service-communication#user_objects
My question pertains to the successhandler and the passing of parameters to the updateButton function. When called in the onclick, the successhandler doesn't include the variables (within the parentheses) in it's call to updateButton. Following the successhandler call is the user object and getEmail but they seem to be out of order (the function updateButton has email before button).
So, how/why does this code work? I've tested it, and even rearranged the variables and what not but the only way it works is in the documentation's writeup. I am unable to understand how the updateButton function knows the parameter values when they are not included in the call to updateButton and they seem to be out of order in the example. Thoughts?