From 5a3aa3fcd3d145884fb769f17795cee3cf6b4b77 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 24 Jan 2014 01:02:58 +0100 Subject: Add main.js to repository --- cam_public/main.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cam_public/main.js (limited to 'cam_public') 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); -- cgit v1.2.1