Page 3 of 3
Re: Added a PondCam
Posted: Sun 29 Sep 2013 9:08 pm
by gluepack
Oh, thanks but I have switched to jQuery with...
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
window.setInterval("refreshCamera();", 10000); // ten seconds interval
});
var url = 'http://www.jerbils.info/current.jpg?refresh=';
var forcerefresh = 0;
function refreshCamera()
{
forcerefresh = forcerefresh + 1;
$('#pondcam').attr('src',url + forcerefresh);
}
</script>
<img id='pondcam' alt='Loading...' />
With the provisos added to my previous post.
Re: Added a PondCam
Posted: Sun 29 Sep 2013 9:13 pm
by mcrossley
Just add a call to refreshCamera() into your onload function to perform the initial image load.
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
refreshCamera();
window.setInterval(refreshCamera, 10000); // ten seconds interval
});
var url = 'http://www.jerbils.info/current.jpg?refresh=';
var forcerefresh = 0;
function refreshCamera() {
forcerefresh = forcerefresh + 1;
$('#pondcam').attr('src',url + forcerefresh);
}
</script>
Re: Added a PondCam
Posted: Sun 29 Sep 2013 9:49 pm
by gluepack
Phew, thanks very much for that. It is working fine now.
The two variables have to be set up front though?
I tried your other code mod but that didn't have any effect, IE and FF still didn't refresh.
Thanks for all your help.
Err... there is still something weird. With IE, I will do a manual refresh and it will show the "current" image and then will switch back to one from a couple of hours ago and update that. Has it retained these images in local cache? Surely the ? parameter shouldn't have any effect on which image is shown it should still pull the current image from the host shouldn't it? (both FF and IE were doing it earlier but FF seems ok now). And, this only happened when Chrome and FF were up showing the same web page. When I closed the tab in both of those and refreshed the IE version, it updated normally. It still begs the question of whether I have two hours worth of images (about 35mb) sitting on my hard drive somewhere.
Re: Added a PondCam
Posted: Fri 18 Oct 2013 7:30 am
by Manzara
Looking at your pics you say you have put polarizing film over the lens and not much change. Have you rotated the filter in all directions to get the maximum polarizing effect?
Re: Added a PondCam
Posted: Fri 18 Oct 2013 1:06 pm
by beteljuice
Hmm ... with this code:
Code: Select all
var url = 'http://www.jerbils.info/current.jpg?refresh=';
var forcerefresh = 0;
function refreshCamera() {
forcerefresh = forcerefresh + 1;
$('#pondcam').attr('src',url + forcerefresh);
forcerefresh is
always a definitive number (starting 0, 1, 2, 3 etc.) and thus the url could well be in your browser(s) cache.
Make it a timestamp instead.
BTW - there is no need for refresh=, just .jpg?value
Re: Added a PondCam
Posted: Mon 28 Oct 2013 9:09 pm
by gluepack
The wonders of software... with the change from summertime, Yawcam doesn't seem to have fathomed it out. I don't even know where it gets the time from, certainly not my system as that is correct.
Re: Added a PondCam
Posted: Mon 30 Dec 2013 4:01 pm
by gluepack
Well... I had to shut down the system that runs Cumulus and Yawcam with a long power button. In doing so I lost both the Cumulus and Yawcam ini files. I re-established the one for Cumulus, no problem, as I have had to do it before and so now keep an up-to-date copy. However, I had to set up the FTP for Yawcam again and, my memory being what it is, I couldn't remember the file name for the stream that Yawcam picks up. Anyway, I eventually figured it out but now the problem is that...
...running under Win 8.1 on the desktop system that Cumulus, etc. runs on, the pond cam image displays and refreshes on my website under Chrome, no problem, but
... running under Win 7 on my laptop, the pond cam image displays initially but then (presumably at refresh) I get white space where the image should be and it never returns until I manually refresh the page.
http://www.jerbils.info/saratoga/wxpondcam.php
Any ideas?
Hah! after just saying that I returned to my laptop and it was displaying/refreshing ok. However, I manually refreshed and the same problem, it shows the image for a few seconds then goes to white space. When I said "it was displaying/refreshing ok" it was remaining on the screen. Now it is refreshing briefly and then disappearing and eventually, ahhhh and after 5 or so minutes of this, it is remaining on the screen.
Re: Added a PondCam
Posted: Mon 30 Dec 2013 10:43 pm
by beteljuice
Not having any problems with IE8 or FireFox.
You never changed your code to date or random as I suggested above. So you could have cache problems.
Re: Added a PondCam
Posted: Fri 31 Jan 2014 8:13 pm
by gluepack
..