WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: hcorrin on April 14, 2022, 09:18:40 AM
-
i notice since putting the 95e version on of the alternate dashboard the the last hour dew value is wrong https://www.hc-iom.co.uk/WD-AJAX1/index.php
the 95c version gives this https://www.hc-iom.co.uk/WD-AJAX3/index.php
not sure what i need to change to get it right
-
In 695e the line
<span class="convDdif"><?php echo strip_units(abs($dewchangelasthour)) . $uomTemp; ?></span>
was used to reflect it was a difference. 695c had that coded as <span class="convTemp"><?php echo strip_units(abs($dewchangelasthour)) . $uomTemp; ?></span>
for a temperature. With testtags.php having $dewchangelasthour = '-0.2'; // Dew point change last hour
the convertDdif function of Number.prototype.convertDdif = function() { // °C
switch (uom.Temp) {
case "°F" :
case "°F": return((this * 1.8) + 32.0);
default : return((this * 1.0) + 17.8);
}
};
in ajaxWDwx3.js was in error. It should read as Number.prototype.convertDdif = function() { // °C
switch (uom.Temp) {
case "°F" :
case "°F": return((this * 1.8));
default : return((this * 1.0));
}
};
to reflect the differences in degree scales from C to F without the offset.
-
ok have corrected the ajaxWDwx3.js and the value looks ok now
Thanks Ken