Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >
- <title>Kontrol On/Off</title>
- <script type="text/javascript" src="includes/swfobject.js"></script>
- <script src="includes/jquery.js"></script>
- <script>
- $(document).ready(function()
- {
- $('div.light').html('<img src="images/off.png" width="50" height="50">')
- setInterval(function()
- {
- $('#timeval').load('includes/time.php');
- }, 1000);
- $('.light').click(function()
- {
- $('.debug').load('handlers/light.php');
- setTimeout(function()
- {
- var mydata = $('div.debug').text();
- if (mydata == 1)
- {
- $.getScript("audio_handlers/audio.php");
- $('div.light').html('<img src="images/on.png" width="50" height="50">')
- $('div.status').text("Lampu Nyala")
- }
- else if (mydata == 0)
- {
- $.getScript("audio_handlers/audio.php");
- $('div.light').html('<img src="images/off.png" width="50" height="50">')
- $('div.status').text("Lampu Mati")
- }
- ;}, 100);
- });
- });
- </script>
- </head>
- <body>
- <div></div>
- <div id="timeval"></div>
- <div id="sound_container"></div>
- <h1>Nyalakan Lampu On/Off</h1>
- <div class="light" >Image On/Off disini</div>
- <div class="debug" style="display: none;">Mulai</div>
- <div class="status" > Lampu Mati </div>
- <p>Dinas Perhubungan <a href="http://openwrt.org" target="_blank">Kota Tegal</a> </p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement