<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function sample(){ var canv = document.getElementById('memo'); var ctx = canv.getContext('2d'); google.script.run .withSuccessHandler(function(z) { ctx.beginPath(); ctx.moveTo(z[1], 50); ctx.lineTo(z[2], 250); ctx.lineTo(z[3], 50); ctx.stroke(); }) .withFailureHandler(function(msg) {}) .doc(); } </script>