/ Published in: jQuery
Javascript/jQuery to check for the time
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ var auto_refresh = setInterval( // Check every 60 seconds function () // Call out to get the time { $.ajax({ url: 'checkTime.php', type: 'POST', success: function(data){ if(data == 'true'){ location.reload(true); } // end if } // end success }); // end ajax call }, 60000); // end check }); // end ready </script>