Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>My First Light Switch</title>
- <script>
- function lights(onoff) {
- var oReq = new XMLHttpRequest();
- oReq.open("GET", "/lights.php?" + onoff);
- oReq.send();
- }
- </script>
- </head>
- <body>
- <button onclick="lights('on')">Turn on the lights</button>
- <button onclick="lights('off')">Turn off the lights</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement