Hi there...I'm not much of a programmer, but I'm hoping someone will take pity on this newbie :)
I have a webcam that uploads an image to my non-profit's website via FTP every 15 seconds. The filename is webcam.jpg.
I have a javascript that automatically reloads the image (NOT the entire page) every 15 seconds as well. The script is as follows (I can't compose javascript, I'm not much of a programmer, so I borrowed this from someone's tutorial website on the subject):
<script type="text/javascript">
function reloadImage() {
var now = new Date();
if (document.images) {
document.images.myobject.src = 'images/webcam.jpg?' + now.getTime();
}
setTimeout('reloadImage()',15000);
}
setTimeout('reloadImage()',15000);
</script>
The script works great--the webcam image refreshes every 15 seconds without refreshing the entire page.
What I'm trying to do is add javascript that will also display the timestamp of the webcam.jpg file when the image is refreshed (so that people know what time/date the image they're looking at was taken).
I'm guessing this involves some sort of AJAX request, but I haven't the foggiest idea how to make it happen. Would anyone be able to help me with this? I sure would appreciate it very much.