Скрипт каждые 60 секунд отправляет ajax запрос php скрипту.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| <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> |
|