function doGet(e) {
// console.log(e);
Logger.log(e.parameter);
return HtmlService.createHtmlOutputFromFile('index');
}
function writeData(title,content){
var url = "https://docs.google.com/spreadsheets/d/1j3--BE4rtz98N_7o3v-WgoMdCKXyrBzt0ZWyhebxSMM/edit#gid=0";
var ss = SpreadsheetApp.openByUrl(url);
var ws = ss.getSheetByName('data');
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h1> hello world! </h1>
<label for="title"> title : </label>
<input type="text" id="title">
<br>
<label for="content"> content : </label>
<input type="text" id="content">
<button id='btn'> write </button>
<script>
document.getElementById('btn').addEventListner('click',doStuff);
function doStuff(){
var title = document.getElementById("title").value;
var content = document.getElementById("title").value;
google.script.run.writeData(title,content);
document.getElementById("title").value = '';
document.getElementById("content").value = '';
}
</script>
</body>
</html>
Logger.log(title.content);
ws.appendRow([title, content]);
}
몇번을 똑같이 해봤는데 web에서 버튼 눌러도 아무 작동이 안되요 ㅠ
아무리 다른 유툽 찾아보고해도 모르겠습니다 ㅠㅠ 도와주세요