bzcomputers
08-01-2012, 11:16 PM
I have this code to refresh an image on a page every 30 seconds, it is working well:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
setInterval(function() {
$('.cameraimage').attr('src', $('.cameraimage').attr('src') + '?d=' + new Date().getTime());
}, 30000);
});
</script>
I would now like to be able to display a countdown timer below the image to show the time till image refresh.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
setInterval(function() {
$('.cameraimage').attr('src', $('.cameraimage').attr('src') + '?d=' + new Date().getTime());
}, 30000);
});
</script>
I would now like to be able to display a countdown timer below the image to show the time till image refresh.