JavaScript - Get Google Sheet data using jQuery

var spreadsheetId = "1Aoz_GcPYoEIMMNd1N_meYNOp8TJ0fCXpp1AoUhCpwZo", url = "https://spreadsheets.google.com/feeds/list/" + spreadsheetId + "/od6/public/basic?alt=json"; jQuery.get({ url: url, success: function(response) { var data = response.feed.entry, len = data.length, i = 0, parsedData = []; for (i = 0; i < len; i++) { parsedData.push({ label: data[i].title.$t, value: data[i].content.$t.replace('Income: ', '') }); } console.log(parsedData); } });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.