How to use jquery to calculate the data in json?

The

code page is shown as follows (showing the numbers of the last 5 issues):
16
12
13
6
1
requires summation and division of numbers by 5, and the result is displayed on the page, (16 "12" 13 "6" 1) / 5 "9.6 (keep integers only)
effect is as follows:
16
12
13
6
1
result: 9 (you need to output this code, how to do it) < /

the following is the page code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<div id="okay"></div>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url: "http://f.apiplus.net/ssq.json",
dataType: "jsonp",
type: "POST",
timeout: 5000, //5
cache: false, //
jsonp: "callback",
success: function(result){
for (var i=0; i < result.data.length; iPP) {
var blue = parseInt(result.data[i].opencode.substr(18, 2));//
$("-sharpokay").append("<br>");
$("-sharpokay").append(blue);//
}
},
});
});
</script>
</body>
</html>
Dec.02,2021

$.ajax({
url: 'http://f.apiplus.net/ssq.json',
dataType: 'jsonp',
type: 'POST',
timeout: 5000, //5
cache: false, //
jsonp: 'callback',
success: function(result){
  for (var i=0,val=0; i < result.data.length; iPP) {
   var blue = parseInt(result.data[i].opencode.substr(18, 2));//
   val+=blue;
   $("-sharpokay").append(blue+'<br>');
  }
 $("-sharpokay").append(parseInt(val/result.rows));
 }
});

var sum = 0;
for (var iTuno; I < result.data.length; iPP) {

sum = sum + parseInt(result.data[i].opencode.substr(18, 2));

}
$("- sharpokay"). Append ('
'+ parseInt (sum/5-1));
what I did later, I didn't expect result.rows to do this
Thank you very much!

)
Menu