AMONRA75

PHP JS JQ - LIVE UPDATE

May 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <html>
  2. <head>
  3.    
  4. <title>Page Title</title>
  5.  
  6. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  7. <script type="text/javascript">
  8.  
  9.  
  10.     $(document).ready(function(){    
  11.         loadstation();
  12.     });
  13.    
  14.     function loadstation(){
  15.         $("#station_data").load("test.php");
  16.         setTimeout(loadstation, 5000);
  17.     }
  18.    
  19.     </script>
  20.    
  21.    <script type="text/javascript">
  22.         $( document ).ready(function() {
  23.         $this = $('h1');
  24.            $this.css('color','#3498db');
  25.            $this.css('text-align','center');
  26.            $this.css('border','1px solid #ededed');
  27.         });
  28.       </script>
  29.  
  30.  
  31. <script type="text/javascript">
  32. $(document).ready(function(){
  33.     var score = $('#station_data').text();
  34.     console.log(score);
  35.     if (score > 0.00 )
  36.     {
  37.         //$('#station_data').css('background-color','gren');
  38.         $('#station_data').css('color','green');
  39.     }else
  40.   {
  41.         //$('#station_data').css('background-color','green');
  42.         $('#station_data').css('color','red');
  43.     }
  44.    
  45. });
  46. </script>
  47.  
  48.  
  49. </head>
  50.  
  51. <body>
  52.     <div id="station_data"></div>
  53.     <h1>Title</h1>
  54.  
  55. </body>
  56. </html>
Add Comment
Please, Sign In to add comment