How often is your lightning map updated? If it’s longer than the AJAX update cycle, then it’s probably best to not add the refresh into your ajaxWDwx.js script.
Something like this on the page can refresh the image at a frequency more like that which you may be uploading the lightning map
<img src="lightningmap.jpg" id="myPull" alt="Lightning Map" width="320" height="240" />
<noscript><p><strong>Note:</strong> You need to enable JavaScript to view the images automatically refreshed.</p>
</noscript>
<script type="text/javascript">
var reloadSecs = 60; // reload every 60 seconds
function reloadImage() {
var now = new Date();
if (document.images) {
document.images.myPull.src = 'lightningmap.jpg?' + now.getTime();
}
setTimeout('reloadImage()',reloadSecs*1000);
}
setTimeout('reloadImage()',reloadSecs*1000);
</script>
Since the ajaxWDwx.js script actually runs the ajaxLoader() function at a different interval that what you want to refresh the data/map, there’s not a measurable performance penalty with running the map refresh with a bit of inline JavaScript code.
I was wondering if this js code could be used to update the EC national radar image on the Canadian ajax template so the whole page wouldn’t have to be reloaded to refresh the image? I tried the code, but then realized that if the ec-radar.php script isn’t run, the -0.png image isn’t refreshed from the EC site. #-o Can the “id=” be moved up into the
for the top of the screen, or just before the “include_once(“ec-radar.php”);” call, or am I barking up the wrong tree? :? I just looked again, the
would cause the whole dashboard to refresh! #-o guess that won’t do! 8O
Is ec-radar.php a graphic script?
If it sends a header then you can just call up the image using a
The only problem I have with this script is that if you have a page parker the person will chew up your bandwidth.
Thats why I tried to setup a timeout like the AJAX scripts do but failed, LOL
No the ec-radar.php “harvests” 8 .png images from the EC site to give a jscript animation, the dashboard uses the “youngest” image of the set.
Did you look at the way the ajax does the maxupdates? There should be a way to add an “if-then” check on a counter variable that gets incremented by one every time the image gets refreshed, when it exceeds the max value, drop out of the loop until the page gets reloaded and the variable gets reset. This stuff is reminding me of my BBS days writing code using a specialized version of compiled BASIC that was used for the BBS package I ran. Worse part, I’m begining to remember some of my code! 8O #-o
Maybe Ken can shed some light on how we can make it happen, who knows, we both might have been looking right at the answer all along! #-o