cloudy cloudy

Author Topic: Javascript %feelslike%  (Read 3977 times)

0 Members and 1 Guest are viewing this topic.

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Javascript %feelslike%
« on: September 30, 2004, 10:08:50 PM »
Since Brian is away... I thought I'd play with some javascript to see if I could get %feelslike% to work like I want it to....

Functioning code:

[code:1]<html>
<head>

<title>Test</title>
</head>
<body onload="feelslike()">

<SCRIPT LANGUAGE="JavaScript">

<!-- This script made by Tom Chaplin -->
<!-- Don't steal it. It's mine, you hear me? MINE MINE! -->
<!-- Ok, but give it back when you're done. -->

<!-- Begin
function feelslike() {
var currenttemp = %tempnodp%;
var heatindex = %heatinodp%;
var windchill = Math.round(parseFloat("%windch%"));
if (currenttemp >= 75)
      {feelsTemp = heatindex + " F";
       feelsText = "Heat Index";}
    else if ( currenttemp < 60 )
      {feelsTemp = windchill + " F";
       feelsText = "Wind Chill";}
    else
      {feelsTemp = currenttemp + " F";
       feelsText = "Feels Like";}
feelstemp.innerHTML = feelsTemp;
feelstext.innerHTML = feelsText;
}
//  End -->
</script>
<b><span id="feelstext"></span></b><br>
<span id="feelstemp"></span><br>


</body>
</html>[/code:1]

You can see it working on my index page.... works in both IE 6 and FF 1

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline Weather Display

  • Posts: 87,192
  • Davis VP2
  • New Zealand
    • Weather Display
Javascript %feelslike%
« Reply #1 on: October 02, 2004, 08:37:51 PM »
hi
so is not still not behaving? (in wd)
i.e if there is wind, the units are then wrongly converted?
but no wind its ok?
that will be the clue (no wind means its just set to the current temperature)

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Javascript %feelslike%
« Reply #2 on: October 02, 2004, 09:07:21 PM »
Hey Brian,

Check out this link:

http://www.weather-watch.com/smf/index.php?topic=5518.0

I think it's the Wind Chill tag which is throwing off feelslike.

But you're right. It seems to happen when there is no wind.
« Last Edit: October 20, 2004, 07:28:55 AM by administrator »

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline Weather Display

  • Posts: 87,192
  • Davis VP2
  • New Zealand
    • Weather Display
Javascript %feelslike%
« Reply #3 on: October 03, 2004, 08:05:23 PM »
i have redone the feelslike tag
in a new 10.17v version
try that

 

cumulus