Looping Ajax call with setInterval() - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:ajax

Description

Looping Ajax call with setInterval()

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
      <script>
        function myFunction(){//  w  w  w. j  a  v  a  2  s . co  m
            $("#div1").load("feeds.php");
        }
        $(document).ready(function() {
            setInterval(myFunction, 1000);
        });
    
      </script> 
   </head> 
   <body> 
      <div id="div1"></div>  
   </body>
</html>

Related Tutorials