Advertisement
myarkqub

Waktu Solat

Feb 7th, 2020
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.00 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Waktu Solat</title>
  8.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  9. </head>
  10. <body>
  11.     <div id="waktu_solat"></div>
  12.     <script>
  13.         $(document).ready(function(){
  14.             var waktu = ["Subuh", "Syuruk", "Zohor", "Asar", "Maghrib", "Isyak"];
  15.             $.getJSON("https://mpt.i906.my/mpt.json?code=mlk-0&filter=1", function(data){
  16.                for(var i = 0; i < data.response.times.length; i++){
  17.                    var d = new Date(data.response.times[i] * 1000);
  18.                    var jam = d.getHours();
  19.                    var minit = d.getMinutes();
  20.                    $("#waktu_solat").append(waktu[i] + " &nbsp; " + jam + ":" + minit + "<br>");
  21.                 }
  22.             });
  23.         });
  24.     </script>
  25. </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement