-
Notifications
You must be signed in to change notification settings - Fork 1
/
gas.html
27 lines (26 loc) · 905 Bytes
/
gas.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Chrimata Index</title>
<script type="text/javascript" src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$.get("http://api.eia.gov/series/?api_key=e4119e96e24c0a2e9e16bbb16f3d596e&series_id=STEO.NGHHMCF.A", function(res){
var html_str="";
var arr = res.series[0]['data']
for (var i=0; i<arr.length; i++){
html_str += "<p>"+res.series[0]['data'][i][0] + " " + res.series[0]['data'][i][1]+"</p>";
$('#info').html(html_str);
}
}, 'json');
return false;
});
</script>
</head>
<body>
<h1>Hello</h1>
<div id="info">
</div>
</body>
</html>