cloudy cloudy

Author Topic: Sky conditions text incorrect  (Read 222 times)

0 Members and 1 Guest are viewing this topic.

Offline blainec

  • Global Moderator
  • Posts: 316
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 57.0
    • Calgary Alberta
Sky conditions text incorrect
« on: November 27, 2017, 04:44:56 AM »
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 saratogaWX

  • Global Moderator
  • Posts: 5,685
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 57.0
    • Saratoga Weather
Re: Sky conditions text incorrect
« Reply #1 on: November 27, 2017, 04:57:11 PM »
Hi Blaine,

When your page first loads, the PHP produces
Code: [Select]
<tr>
                    <td style="border: none;" align="center" valign="middle">
                        <span class="ajax" id="ajaxconditionicon2">
                        <img src="./ajax-images/sct.gif" alt="Mostly cloudy" title="Mostly cloudy" width="74" height="74">
                        </span>
                    </td>
                    <td style="text-align: center; border: 1px solid gray;" align="center">
                        <span class="ajax" id="ajaxcurrentcond">
                        Mostly cloudy </span><br><br>
                    </td>
                </tr>
as the display for icon/conditions.  That all comes from ajax-dashboard3.php and testtags.php values.

After the AJAX script cuts in (ajaxWDwx3.js), the HTML is updated to be
Code: [Select]
<tr>
                    <td style="border: none;" align="center" valign="middle">
                        <span class="ajax" id="ajaxconditionicon2" lastobs="3" style=""><img src="./ajax-images/sct.gif" style="" alt="Current conditions" align="" width="74" vspace="0" hspace="0" height="74" border="0"></span>
                    </td>
                    <td style="text-align: center; border: 1px solid gray;" align="center">
                        <span class="ajax" id="ajaxcurrentcond" lastobs="Dry" style="">Dry</span><br><br>
                    </td>
                </tr>
and those values are from the JavaScript and clientraw.txt

Your /meteotemplate/wdUpload/testtags.php?sce=view shows
Code: [Select]
   $weathercond = 'Dry';
   $Currentsolardescription = 'mostly cloudy ';
so that is where the PHP 'mostly cloudy' comes from.  Your ajaxWDwx3.js has 
Code: [Select]
var clientrawFile = '../meteotemplate/wdUpload/clientraw.txt'; // location of clientraw.txt relative to this page on website
(which could be used as
Code: [Select]
var clientrawFile = '/meteotemplate/wdUpload/clientraw.txt'; // location of clientraw.txt relative to this page on website
for an absolute URI instead).

That clientraw.txt shows
Code: [Select]
Dry as the value for the current condition.  So the clientraw.txt is not displaying the metar/solar sensor cloud condition.

Hope this helps....
« Last Edit: November 27, 2017, 04:58:43 PM by saratogaWX »
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline blainec

  • Global Moderator
  • Posts: 316
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 57.0
    • Calgary Alberta
Re: Sky conditions text incorrect
« Reply #2 on: November 30, 2017, 04:25:47 AM »
stupid question...

Any idea on how to fix this?

 

cumulus