Javascript/jQuery to check for the time


/ Published in: jQuery
Save to your folder(s)

Javascript/jQuery to check for the time


Copy this code and paste it in your HTML
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. $(document).ready(function(){
  4. var auto_refresh = setInterval( // Check every 60 seconds
  5. function () // Call out to get the time
  6. {
  7. $.ajax({
  8. url: 'checkTime.php',
  9. type: 'POST',
  10. success: function(data){
  11. if(data == 'true'){
  12. location.reload(true);
  13. } // end if
  14. } // end success
  15. }); // end ajax call
  16. }, 60000); // end check
  17. }); // end ready
  18. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.