Fetch data from text file and update web page every minute - Javascript jQuery

Javascript examples for jQuery:Text

Description

Fetch data from text file and update web page every minute

Demo Code

ResultView the demo in separate window

<!doctype html>
<html lang="en">
   <head> 
      <script src="jquery.min.js"></script>
      <script>
  setInterval(function(){get_contents();}, 10000*60);

  function get_contents() {//ww w. j  av  a  2s.  co m
    $.get('file_read.php.php?tail', function(data) {
        $('#contents').append(data);
    });
  }
  
      </script> 
   </head> 
   <body> 
      <div id="contents">
         Loading...
      </div>  
   </body>
</html>

Related Tutorials