Thursday, October 22, 2015

Hold on, back up!


 Google App Script is fun, :)

 Here's my simple hello world, :)

What I did is create "form", which actually have no form at all, just submit button to activate listFilesNFolders(form) function on script (Code.gs file)

The code will return output 'tadaa...', 'heheh...', and 'Hello World!!!'.

Notice the html formatting, :)



function listFilesNFolders(form) {
  var list = [];
  list.push(['tadaa...<br>']);
  list.push(['heheh...']);
  var row = [];
  row.push('<br>Hello World!!! ');
  list.push(row);
  

  return list;
}

function doGet(e) {
  return HtmlService.createHtmlOutputFromFile('form.html');
}

.
 <form id="myForm">
  <input type="submit" 
    value="OK"        
    onclick="
    this.value='Proses';
    google.script.run.withSuccessHandler(fileUploaded).listFilesNFolders(this.parentNode);
    return false;
    "
                    >
  </form>

.