Guest User

Untitled

a guest
Feb 2nd, 2017
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  2. <script type="text/javascript">// <![CDATA[
  3. $(document).ready(function() {
  4. $('#on').click(function(){
  5. var a= new XMLHttpRequest();
  6. a.open("GET", "pin24on.php"); a.onreadystatechange=function(){
  7. if(a.readyState==4){ if(a.status ==200){
  8.  } else alert ("http error"); } }
  9. a.send();
  10. });
  11. });
  12. $(document).ready(function()
  13. { $('#Off').click(function(){
  14. var a= new XMLHttpRequest();
  15. a.open("GET", "pin24off.php");
  16. a.onreadystatechange=function(){
  17. if(a.readyState==4){
  18. if(a.status ==200){
  19.  } else alert ("http error"); } }
  20. a.send();
  21. });
  22. });
  23. </script>
  24. <button id="on" type="button"> Switch Lights On </button>
  25. <button id="off" type="button"> Switch Lights Off </button>
Add Comment
Please, Sign In to add comment