Author Topic: Alternate Dashboard Issue  (Read 855 times)

0 Members and 1 Guest are viewing this topic.

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Alternate Dashboard Issue
« on: August 07, 2020, 11:38:23 AM »
I installed the alternate dashboard earlier this week and it's really amazing.

So far, I've only found one glitch that I don't know how to fix.

There is a 'METRIC|IMPERIAL' label that toggles the readings.  Since I use Imperial, the Imperial label should be highlighted when I access the page.  It's not.

When I click on the Imperial label I get an error.  I get a popup error stating that 'Your "undefined" value can not be found', but the values change after dismissing the message.  Subsequent clicks on either label work without an error message.  It's just the first click.

i'm not sure how to fix this and any help is appreciated.

https://www.m82a1.us/index.php
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternate Dashboard Issue
« Reply #1 on: August 07, 2020, 03:58:00 PM »
Be sure you're using this version of 'ajaxWDwx3.js'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Alternate Dashboard Issue
« Reply #2 on: August 07, 2020, 04:25:03 PM »
Hi Jerry,

That download only has one line of code in it?
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternate Dashboard Issue
« Reply #3 on: August 07, 2020, 05:25:44 PM »
It’s minified JavaScript file, so there’s only one line. Just remove the ‘.txt’.

I can provide the source when I get a chance.
« Last Edit: August 07, 2020, 05:27:58 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Alternate Dashboard Issue
« Reply #4 on: August 07, 2020, 06:32:37 PM »
Actually, I don't think I was any help.  The error message occurs, but clicking through it then allows subsequent metric-imperial switching.

All of your scripts are up-to-date with 'check-fetch-times.php?show=versions', so it looks like this one's for Ken...
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Alternate Dashboard Issue
« Reply #5 on: August 07, 2020, 06:35:03 PM »
I replied after you posted...

Sorry about that.  You're correct and it runs fine.

Except I still get the error message when first clicked.  After that, it's fine.  I'm befuddled.
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternate Dashboard Issue
« Reply #6 on: August 10, 2020, 12:41:12 PM »
Try commenting out the <script> invocation for floattop.js on your index.php page.  I think there's a window.onload interference between it an the ajaxWDwx3.js script initialization functions.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Alternate Dashboard Issue
« Reply #7 on: August 10, 2020, 12:52:38 PM »
Ken,

It's not in index.php but menubar.php.  I commented it out anyway but I still see the error.
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternate Dashboard Issue
« Reply #8 on: August 10, 2020, 01:16:27 PM »
Please post a copy of your AltAjaxDashboardConfig6.php (copy to a .txt file and attach it to a post).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Alternate Dashboard Issue
« Reply #9 on: August 10, 2020, 01:37:02 PM »
Here ya' go, Ken

Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Alternate Dashboard Issue
« Reply #10 on: August 10, 2020, 02:12:52 PM »
Your AltAjaxDashboardConfig6 looks ok.

I think the issue is your additional script in header.php of
Code: [Select]
<script type="text/javascript">
tday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

function GetClock(){
var d=new Date();
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear();
if(nyear<1000) nyear+=1900;

document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+"";
}

window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
</script>
<div id="clockbox"></div>
that's causing the malfunction.  Change the
Code: [Select]
window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
to
Code: [Select]
  if (typeof window.onload != 'function') {
    window.onload=function(){
      GetClock();
      setInterval(GetClock,1000);
    }
  } else {
    var oldOnLoad = window.onload;
    window.onload = function() {
      oldOnLoad();
      GetClock();
      setInterval(GetClock,1000);
    };
  }
to prevent interference with the window.onload function in ajaxWDwx3.js.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Alternate Dashboard Issue
« Reply #11 on: August 10, 2020, 02:29:28 PM »
Wow!  Good deal, Ken.  It's a wrap.  I never would have found that.

Appreciate it,
Mort
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station