Skip to content

Commit

Permalink
test JSON
Browse files Browse the repository at this point in the history
with Test file
  • Loading branch information
yanyiyi committed Jul 3, 2018
1 parent e1cd579 commit b679fb3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions GoogleSheetRead.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script id="scriptMain" src="./js/textJSON.js"></script>
</head>


<body>
<div id="ext">1234</div>
</body>

</html>
19 changes: 19 additions & 0 deletions js/textJSON.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$(document).ready(function () {
$(function () {
var aLatitude = [];
var aLongtitude = [];
var dataAmount = 0;
console.log("w");
$.getJSON('https://spreadsheets.google.com/feeds/list/1eUgqe2z8gL1d9GrY2LwpAAxW9Wh2xOKOopqDNcISdpE/1/public/values?alt=json', function (dataLog) {
console.log("gJson");
dataAmount = dataLog.feed.entry.length;
console.log(dataAmount);
for (var i = 0; i < dataAmount; i++) {
aLatitude[i] = dataLog.feed.entry[i].gsx$lati.$t;
aLongtitude[i] = dataLog.feed.entry[i].gsx$longi.$t;
$('#ext').append(aLatitude[i] + aLongtitude[i]);
} //end for
} //end function data
); //end get JSON
}); //end function
});

0 comments on commit b679fb3

Please sign in to comment.