以下のスクリプトのようにgoogle.script.runの入れ子のような処理を行いたいのですが、可能でしょうか?
現状、なぜかエラーログが確認できないのでこの処理を実行しても特に何も起きずに終わってしまっています。
関数が実行されているかどうかはこちらの方法でログデバッグを仕込んで確認しています。
もし何か別の方法などがあればご教授ください。
よろしくお願いいたします。
code.gs
GAS
1function log(data){ 2 Logger.log(data); 3} 4 5function sayHello(){ 6 return “Hello”; 7}
index.html
html
1<!DOCTYPE html> 2<html xmlns=“http://www.w3.org/1999/xhtml”> 3 4<head> 5 <base target=“_top”> 6 <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” /> 7 <title>App01</title> 8 <script type=“text/javascript”> 9 function OnClick() { 10 google.script.run 11 .withSuccessHandler(function (data) { 12 google.script.run.log(data); 13 }) 14 .sayHello(); 15 } 16 </script> 17 18</head> 19 20<body> 21 <input id=“button” type=“button” value=“インポート” onclick=“OnClick();” /> 22</body> 23</html>
回答1件
あなたの回答
tips
プレビュー