|
Post by Admin on Jun 21, 2005 9:16:00 GMT -5
This javascript does two things. First, it eliminates that pesky and useless decimal place for windspeed when using miles per hour. (The decimal place is useless for other units of measure, too, since it never changes, just reflecting the equivalent to miles per hour in the unit being used.) It also will show the word "Calm" when there is no wind. So, if the wind is blowing a 4 mph from the NNE, this javascript will return:
NNE at 4 mph
If no wind is blowing, it will return:
Calm
You can easily tweak it for other settings, such as using the new two minute average instead of instant wind speed, etc.
<script language="javascript"> // Script provided courtesy of www.ag-weather.com // var wind = (Math.round(<!--WindSpeed-->))) if (wind >= 0.1) {message = (Math.round(<!--WindSpeed-->)} if (wind >= 0.1) {dir = "<!--WindDirection--> at "} if (wind >= 0.1) {spd = " mph"} if (wind < 0.1) {message = "Calm"} if (wind < 0.1) {blow = ""} if (wind < 0.1) {dir = ""} if (wind < 0.1) {spd = ""} document.write(dir + message + spd) </script>
|
|
|
Post by Admin on Jun 21, 2005 11:52:51 GMT -5
If anybody downloaded the above javascipt before about 1:50 PM Eastern on 6/21, you'll need to grab it again. I found a typo in the original posting that would prevent it from working. Sorry if anybody had to go thru trying to troubleshoot the bad script!!!
|
|