Posted By

poot26 on 02/11/12


Tagged

javascript jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrockSamsom


Javascript/jQuery to check for the time


 / Published in: jQuery
 

Javascript/jQuery to check for the time

  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  

You need to login to post a comment.