Created
February 6, 2013 11:50
-
-
Save hassaku/4722122 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>JSONP TEST</title> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
</head> | |
<body> | |
You can see the follwing satellites from Tokyo Sky Tree. | |
<div id="satellites">Now Loading...<div> | |
<script type="text/javascript"> | |
onload = function() { | |
$.ajax({ | |
url: "http://message-in-a-satellite.herokuapp.com/satellites/35.710208/139.812734/0.0", | |
dataType: "jsonp", | |
success: function(data){ | |
str = '<table border=2 align=center>\n'; | |
str += '<tr bgcolor="#cccccc">\n'; | |
str += '<th>Name</th>\n'; | |
str += '<th>Latitude</th>\n'; | |
str += '<th>Longitude</th>\n'; | |
str += '<th>Altitude</th>\n'; | |
str += '<th>Azimuth</th>\n'; | |
str += '<th>Elevation</th>\n'; | |
str += '<th>Range</th>\n'; | |
str += '</tr>\n'; | |
for(var i=0;i < data.length; i++) { | |
str += '<tr align=center>' | |
str += '<td>' + data[i].name + '</td>' | |
str += '<td>' + data[i].latitude + '</td>' | |
str += '<td>' + data[i].longitude + '</td>' | |
str += '<td>' + data[i].altitude + '</td>' | |
str += '<td>' + data[i].azimuth + '</td>' | |
str += '<td>' + data[i].elevation + '</td>' | |
str += '<td>' + data[i].range + '</td>' | |
str += '</tr>' | |
} | |
str += '</table>\n'; | |
$("#satellites").html(str); | |
}, | |
error: function(xhr, error){ | |
alert(error); | |
} | |
}); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment