besly98 Posted May 5, 2011 Share Posted May 5, 2011 i have this code, it works fine for normal refreshing... <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#match_main').load('match_engin.php1?counter=<?echo $_GET['counter'];?>'); }, 10000); // refresh every 10000 milliseconds </script> but i want to add a counter, so each 10 seconds, when it reloads the DIV, it increments a counter by 1. is this possible? i have been trying for ages i cant fix it... Quote Link to comment https://forums.phpfreaks.com/topic/235587-ajax-automatic-refresh/ Share on other sites More sharing options...
prestonwinfrey Posted May 5, 2011 Share Posted May 5, 2011 <script type="text/javascript"> var count = <?echo $_GET['counter'];?>; var auto_refresh = setInterval( function () { $('#match_main').load('match_engin.php1?counter=' + counter, function () { counter++; }); }, 10000); // refresh every 10000 milliseconds </script> Quote Link to comment https://forums.phpfreaks.com/topic/235587-ajax-automatic-refresh/#findComment-1211020 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.