Advertisement
HizkiFW

Raspberry Pi Light Switch UI

Feb 11th, 2016
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.39 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <title>My First Light Switch</title>
  5.         <script>
  6.             function lights(onoff) {
  7.                 var oReq = new XMLHttpRequest();
  8.                 oReq.open("GET", "/lights.php?" + onoff);
  9.                 oReq.send();
  10.             }
  11.         </script>
  12.     </head>
  13.    
  14.     <body>
  15.         <button onclick="lights('on')">Turn on the lights</button>
  16.         <button onclick="lights('off')">Turn off the lights</button>
  17.     </body>
  18. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement