diff options
Diffstat (limited to 'cam_public')
-rw-r--r-- | cam_public/main.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cam_public/main.js b/cam_public/main.js new file mode 100644 index 0000000..134f194 --- /dev/null +++ b/cam_public/main.js @@ -0,0 +1,20 @@ +window.setTimeout(function() { + var actions = { + left : null, + right : null, + up : null, + down : null + }; + + for (var action in actions) { + (function() { + var laction = action; + document.getElementById(action).onclick = function() { + var request = new XMLHttpRequest(); + request.open("get", "../control/" + laction, false); + request.send(); + return false; + }; + }()); + } +}, 1000); |