Created
June 19, 2013 14:24
-
-
Save erinlin/5814707 to your computer and use it in GitHub Desktop.
google apps script - Serve Google Spreadsheet as JSONP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://me.dt.in.th/page/SpreadsheetToJSONP | |
function onEdit(e) { | |
var value = SpreadsheetApp.getActiveSpreadsheet().getSheets() | |
.filter(function(sheet) { return sheet.getName() != "JS" }) | |
.map(function(sheet) { | |
return { name: sheet.getName(), | |
values: sheet.getDataRange().getValues() }; | |
}); | |
SpreadsheetApp.getActiveSpreadsheet() | |
.getSheetByName("JS").getRange("B1").setValue(JSON.stringify(value)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment