I'm trying to create a message box from my .gs to my web app, I tried these but the message box couldn't show up:
var html = HtmlService.createHtmlOutputFromFile('View');
SpreadsheetApp.getUi().showModalDialog(html, 'Dialog title');
Browser.msgBox('Hello!', Browser.Buttons.OK);
HtmlService.createHtmlOutput("Hello!");
Are those methods the right way to do it? Your response will be appreciated :)
Sample:
Code.js
function doGet() {
return HtmlService.createHtmlOutputFromFile("index");
}
function called(){
Logger.log("I was called");
//the rest of your code
}
index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<script>
if (confirm("Please confirm, are you sure you want to continue?")) {
alert( "google.script.run will be called");
google.script.run.called();
} else {
alert( "You cancelled!");
}
</script>
</body>
</html>