Reputation: 390
I'm trying to build a simple web app using below code. However, when I click the button on html page, log still says no function has been run in this session. I have deployed the latest code, yet no results. I went through several links but I can't figure out what's wrong with the code.
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h1> Hello</h1>
<button id="btn">Calculate</button>
<script>
document.getElementById("btn").addEventListener("click",click_handler);
function click_handler(){
google.script.run.userClicked();
}
</script>
</body>
</html>
function doGet() {
return HtmlService.createHtmlOutputFromFile("page");
}
function userClicked(){
Logger.log("Someone clicked");
}
Upvotes: 0
Views: 1609
Reputation: 6564
The legacy error log window is not working smoothly for V8 run time, But you can view logs under stackdriver logs, you can access the same from script window>View>Stackdriver logging and then from the popup showURL click on 'Apps Script Dashboard.'
You will be able to see each execution that has happened in the script and also the logs under the executions.
Upvotes: 1