Add public URL handler to the button

I created a button, and I applied a handler to this button to collect data from some fields and write them to a spreadsheet. However, I want the script at the end of this operation to open the URL (the summary page of the site where it is connected to my script). How can I apply a link to a button using a handler?

I am trying to do what, in my opinion, was quite simple and seemed like a mystery. I have looked at many stackoverflow pages, but I have not found an answer.

0
source share
1 answer

you can do this using the "a" html element and bind it with the onclick attribute.
Here is the demon and source here

important part of the code:

<a href="<?=yourURL?>" target="_blank"   
onclick="google.script.run.scriptAction(this.parentNode);">click me!</a>
+1

Source: https://habr.com/ru/post/1524841/


All Articles