Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- int cont = 0;
- ?>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script>
- <script>
- req()
- {
- $.ajax({url: "func.php"}, success: function(data) {
- document.getElementById("p1").innerHTML = data;
- });
- setInterval(req(), 2000);
- };
- $('document').ready(function(){
- setInterval(req(), 2000);
- });
- </script>
- <p id="p1">0</p>
- </body>
- <?php
- cont++;
- echo cont;
- ?>
Add Comment
Please, Sign In to add comment