'Add an open url handler to a button
I created a button and I have applied to this button a handler to collect the data of some fields and record them in a spreadsheet. I wish, however, at the end of this operation, the script to open a url (summary page of the site where it is plugged into my script). How can I apply a link to the button via a handler?
I'm trying to do something I thought was rather simple and is proving to be an enigma. I watched through many stackoverflow pages but i haven't found an answer.
Solution 1:[1]
you can do that using a "a" html element and associate it a onclick attribute.
Here is a demo
and the source here
the essential part of the code:
<a href="<?=yourURL?>" target="_blank"
onclick="google.script.run.scriptAction(this.parentNode);">click me!</a>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Harold |