<!DOCTYPE html>
<html>
<head>
</head>
<body onload="sample()">
<p id="memo"></p>
<?!= HtmlService.createHtmlOutputFromFile('sample').getContent(); ?>
</body>
</html>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var x1,x2;
var nn1,nn2;
function sample(){
n=1;
$("#memo").click(function(){
n=n+1;
if(n>5)n=1;
google.script.run
.withSuccessHandler(function(q) {
q1="<h1>"+q+"</h1>";
$("#memo").html(q1);
})
.withFailureHandler(function(msg) {})
.step(n);
});
google.script.run
.withSuccessHandler(function(q) {
q1="<h1>"+q+"</h1>";
$("#memo").html(q1);
})
.withFailureHandler(function(msg) {})
.step(n);
}
</script>
function doGet(e) {
var template = HtmlService.createTemplateFromFile('index');
return template.evaluate()
.setTitle('練習')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function step(n) {
var id="1wAt0LeJTxP9wFNnBFndP4NRtFnV-HxOAe_DupsGqeVQ";
ex1 = SpreadsheetApp.openById(id);
sheet = ex1.getSheetByName("data");
var q=sheet.getRange(n,1).getValue();
return q;
}
最終更新:2016年07月02日 23:49