Update Real-time DIV



  • I would like to update only one div from a site, without updating the entire site and that this div would update 0.1 seconds every 0.1 seconds, and that for example it would not be necessary to refresh or re-enter the site.

    I would basically like to make a change on my server, and not have to update the site to see this change, but I wanted that to happen in just 1 div of my site.

    How can I do that?

    Thank you.



  •    <script>
       var nomedafuncao = function () {
      $('#iddadiv').load('paginaquequercarregar.php?_=' + new Date().getTime());
      };
       setInterval(nomedafuncao, 1000); // <- 1000 tempo em milisegundos = 1 segundo
       </script>
    

    other option and use long pooling




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2