Everything seems to be working with the Belchertown skin except the Reports
page. When the page loads, it shows my 404 page rather than the
preformatted NOAA text file. I have tried a variety of things to figure
this out, but have come up blank.
I looked in the folder and see both a NOAA-2019.txt file and a
NOAA-2019-12.txt file.
If I force load the url with "?yr=2019&mo12", it loads the page just fine
and the links are intact.
When I look at the html for the page, this is what I see:
<script>
jQuery(document).ready(function() {
var month = getURLvar("mo");
var year = getURLvar("yr");
if ( ( year !== undefined ) && ( month !== undefined ) ) {
url = '../NOAA/NOAA-'+year+'-'+month+'.txt';
} else if ( year !== undefined ) {
url = '../NOAA/NOAA-'+year+'.txt';
} else {
url = '../NOAA/';
}
// Load the file into the pre
//jQuery('#noaa_contents').load( url );
populatePre( url );
// Change the direct href link
jQuery(".noaa_direct_link").attr( "href", url );
});
// Change the div to the right NOAA file
// I normally use PHP for this, but JavaScript seems to work well
for the skin
// Source: https://stackoverflow.com/a/18933218/1177153
function populatePre(url) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
raw_content = this.responseText;
updated_content =
raw_content.replace('<sup>','').replace('</sup>','').replace('°','');
document.getElementById('noaa_contents').textContent =
updated_content;
};
xhr.open('GET', url);
xhr.send();
}
</script>
If you notice, the "else" statement shows url = '../NOAA/'; with no text
file at the end as a default value.
In trying to figure out what is going on, I looked at
https://belchertownweather.com/reports/. I even copied the basic html from
view source and saw nothing that stands out.
About the only thing I see that is different is the version numbers on some
of the JS code and the skin itself.
I'm using Belchertown Skin Version: 1.0.1. The main Belchertown site is
using 1.1b8. I don't know if that makes a difference.
Is this a problem others have seen? Is there something I'm missing? I have
skin loaded in:
https://myprimarysite.com/weewx/main
I have set the weewx.conf with the following:
[[Belchertown]]
HTML_ROOT = /mywebroot/weewx/main
skin = Belchertown
forecast_enabled = 1
enable = True
I like the skin, but am at a loss to sort out why the reports aren't
working.
Any help would be great. If I missed a piece of information, please let me
know.
Thank you!
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/dd0df3af-fce7-43df-a45f-f10e192bc699%40googlegroups.com.