So, looking around the world, I found an easy way to do a “fix”:
<script> $(document).ready(function() { $("#refresh").click(function() { $("#Container").load("content-that-needs-to-refresh.php"); return false; }); }); </script> <div id="Container"> <?php include('content-that-needs-to-refresh.php'); ?> </div> <a href="#" id="refresh">Refresh</a>
in file: content-that-needs-to-refresh.php
You put everything you want to update / Updated / Changed.
File Content: content-that-needs-to-refresh.php
<?php $random = rand(1, 10); $numbers[1] = "1"; $numbers[2] = "2"; $numbers[3] = "3"; $numbers[4] = "4"; $numbers[5] = "5"; $numbers[6] = "6"; $numbers[7] = "7"; $numbers[8] = "8"; $numbers[9] = "9"; $numbers[10] = "10"; ?> <?=$numbers[$random]?>
This will give you a random number every time you click the refresh link.
source share