Created
October 1, 2015 15:09
-
-
Save tiansial/1896f3a6460e1d362d86 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Live Robot</title> | |
</head> | |
<body> | |
<p class="start">Start Your Robot Please.</p> | |
<div id="data"></div> | |
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script> | |
<script src="http://code.jquery.com/jquery-1.11.1.js"></script> | |
<script> | |
var socket = io(); | |
socket.on('notification', function (data) { | |
// var jsonObj = JSON.stringify(data, undefined, 4); | |
// $("#data").text(data); | |
// $(".start").remove(); | |
$.each(data, function(arrayID,obj) { | |
$('#data').append('<ul class="data">'); | |
$('#data').append('<li>' + obj.id + '</li>'); | |
$('#data').append('<li>' + obj.x + '</li>'); | |
$('#data').append('<li>' + obj.y + '</li>'); | |
$('#data').append('<li>' + obj.z + '</li>'); | |
$('#data').append('</ul>'); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment