Author Topic: Sky conditions text not right  (Read 1084 times)

0 Members and 1 Guest are viewing this topic.

Offline blainec

  • Senior Member
  • **
  • Posts: 70
    • Weather YYC
Sky conditions text not right
« on: November 26, 2017, 10:26:18 PM »
When my page first loads the sky conditions test says "Mostly Cloudy" or whatever it is, then about 2 seconds later it changes to "Dry Night time" or something similar.

I can't seem to track down the problem. Can anyone help me out?

http://wxcalgary.com/test

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Sky conditions text not right
« Reply #1 on: November 27, 2017, 05:10:37 PM »
The problem has to do with what goes into the <span> with the ID "ajaxcurrentcond".

The PHP code currently sets it to "mostly clear".

Code: [Select]
<td align="center" style="text-align: center; border: 1px solid gray;">
                        <span class="ajax" id="ajaxcurrentcond">
                        mostly clear </span><br/><br/>
                    </td>

When the javascript runs (via ajaxWDwx3.js as "check-fetch-times.php?view=wx" reveals), it gets changed to "Dry".

Code: [Select]
<span class="ajax" id="ajaxcurrentcond" lastobs="Dry" style="">Dry</span>
So you need to find a) What data (from the tags) is used to set the condition for the PHP code and b) what realtime data is used to overwrite it in the js code.  I don't have the WD code or I'd check on it.

https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

 

anything