summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrien Nader <adrien@notk.org>2012-01-20 21:46:38 +0100
committerAdrien Nader <adrien@notk.org>2012-01-20 21:46:38 +0100
commitb3ce9f5f061a19b04d3924c55adce6ffa51ed192 (patch)
tree30fdbd24865133246c7ea8ad58b3c3fd440b6d46
parent9a2a1b47610ed6a855828373071e99bced82b861 (diff)
web/client: don't keep on updating once it failed.adrien/web/server
-rw-r--r--web/slam-bang.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/slam-bang.html b/web/slam-bang.html
index 73bceb9..716b773 100644
--- a/web/slam-bang.html
+++ b/web/slam-bang.html
@@ -3,10 +3,10 @@
<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript">
var sp_position = function(position) {
- return (position.x + ', ' + position.y + ', ' + position.z);
+ return ('Position: ' + position.x + ', ' + position.y + ', ' + position.z);
};
var sp_orientation = function(orientation) {
- return (orientation.x + ', ' + orientation.y + ', ' + orientation.z + ', ' + orientation.w);
+ return ('Orientation: ' + orientation.x + ', ' + orientation.y + ', ' + orientation.z + ', ' + orientation.w);
};
var update = function() {
$.getJSON("http://notk.org/~adrien/slam-bang.json", function(data) {
@@ -18,8 +18,9 @@
p.push(s);
}
$("#placeholder").html('<ul>' + p + '</ul>');
+ if (data)
+ setTimeout(update, 1000);
});
- setTimeout(update, 1000);
};
$(document).ready(function() {
update();