index.html 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <html>
  2. <head>
  3. <title>Doggie Radio UI - By Seanland</title>
  4. <link rel="stylesheet" href="main.css">
  5. <script type="text/javascript" src="jquery-3.4.1.min.js"></script>
  6. </head>
  7. <h1>Doggie Radio</h1>
  8. <a href='#' onclick="radio(1);">Seanland's Game Music</a>
  9. <a href='#' onclick="radio(2);">Seanland's Top 100s</a>
  10. <a href='#' onclick="radio(3);">Seanland's Collection</a>
  11. <a href='#' onclick="radio(stop);" class="stop">Stop Music</a>
  12. <script type='text/javascript'>
  13. //AJAX function
  14. function radio(com) {
  15. // change IP based on the player's address
  16. var ip = "192.168.1.40";
  17. $.ajax({
  18. type: "POST",
  19. url: "https://" + ip + "/radio.php",
  20. xhrFields: {
  21. withCredentials: true
  22. },
  23. data: "radio=" + com,
  24. success: function(msg){
  25. // may add in the future
  26. },
  27. error: function (xhr, status) {
  28. // handle errors
  29. }
  30. });
  31. }
  32. </script>
  33. </html>