WeatherLink Software Board
« Another Windspeed Javascript »

Welcome Guest. Please Login or Register.
Nov 27, 2009, 2:20am




WeatherLink Software Board :: Javascripts, Templates, Graphics, Other Tools :: Javascripts :: Another Windspeed Javascript
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Another Windspeed Javascript (Read 1,400 times)
Admin
Administrator
*****
member is offline

[avatar]

Williamson County, Texas


[homepage]

Joined: Jun 2003
Gender: Male
Posts: 205
Location: Round Rock, TX, USA
Karma: 1
 Another Windspeed Javascript
« Thread Started on Jun 21, 2005, 9:16am »

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.

Code:
<script language="javascript">
// Script provided courtesy of [url]www.ag-weather.com[/url] //
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>
« Last Edit: Jun 21, 2005, 11:51am by Admin »Link to Post - Back to Top  IP: Logged


[image]
Admin
Administrator
*****
member is offline

[avatar]

Williamson County, Texas


[homepage]

Joined: Jun 2003
Gender: Male
Posts: 205
Location: Round Rock, TX, USA
Karma: 1
 Re: Another Windspeed Javascript
« Reply #1 on Jun 21, 2005, 11:52am »

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!!! :P
Link to Post - Back to Top  IP: Logged


[image]
   [Search This Thread][Send Topic To Friend] [Print]


Profile Visitor Map - Click to view visits

Google
Webn6skk.proboards.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!