Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
JavaScript 'Viewer' of Cumulus generated NOAA style reports
Moderator: daj
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
It's more devious than that !
If I look at my examples with IE8 the 'rules' are obeyed, but apparently (having done a google and reading M$ support) it's all down to the DOCTYPE declaration as to wether IE8 obeys the <pre> white-space and line return rules.
If I look at my examples with IE8 the 'rules' are obeyed, but apparently (having done a google and reading M$ support) it's all down to the DOCTYPE declaration as to wether IE8 obeys the <pre> white-space and line return rules.
......................Imagine, what you will KNOW tomorrow !
-
hystrix
- Posts: 8
- Joined: Thu 29 Dec 2011 4:51 pm
- Weather Station: Fine offset
- Operating System: Windows 7
- Location: Somerset, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
I have exactly the same problem. I have created and uploaded NOAA files for 2012, but get exactly the same issue as Radelrama describes above. Can anyone help? The URL to my NOAA page is http://deadwing.webplus.net/DW9194/NOAA-reports.htmlradelrama wrote:Hi beetlejuice and thx a lot for that code!!
I'm using an non-php Webserver and included Cumulus with Steelgauges in my web page since very little time, I have only data for this month...
I was looking for a simple solution to display reports, downloaded thankfully and adapted your files according to your instructions, generated/copied reports month/year.
The reports page loads, counts files correctly, but stays on
"Looking for files reports/NOAAMO0312.txt
Report for ???? ???"
Other users web pages (with the exactly same code) DO display correctly, so shame on me: What am I doing wrong?
Didn't change any code... Tried renaming files for Jan/Feb reports to exist, doesn't change anything.
Well, tried the whole day and humbly asking for help...
Thx 4 help,
Radelrama
Many thanks.
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
For some reason your server returns a code 302 (found / temp redirect) which then for a browser (but not the code) goes to a 404 (file not found).
The 404s are the result of the code looking for all possible files from Jan start year to Dec this year.
Time to get your hands dirty !
Go into the .js file with notepad or similar, go down to
function betelLoader (url, nav, thisnum)
Look for this line:
and change it to:
The 404s are the result of the code looking for all possible files from Jan start year to Dec this year.
Time to get your hands dirty !
Go into the .js file with notepad or similar, go down to
function betelLoader (url, nav, thisnum)
Look for this line:
Code: Select all
if(x.readyState == 4 && x.status == 400) { // file does not exist
Code: Select all
if(x.readyState == 4 && x.status >= 302) { // file does not exist
......................Imagine, what you will KNOW tomorrow !
-
hystrix
- Posts: 8
- Joined: Thu 29 Dec 2011 4:51 pm
- Weather Station: Fine offset
- Operating System: Windows 7
- Location: Somerset, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Many thanks for your quick response. I just changed the noaarep.js file per your instructions, and unfortunately it still does not workbeteljuice wrote:For some reason your server returns a code 302 (found / temp redirect) which then for a browser (but not the code) goes to a 404 (file not found).
The 404s are the result of the code looking for all possible files from Jan start year to Dec this year.
Time to get your hands dirty !
Go into the .js file with notepad or similar, go down to
function betelLoader (url, nav, thisnum)
Look for this line:
and change it to:Code: Select all
if(x.readyState == 4 && x.status == 400) { // file does not existCode: Select all
if(x.readyState == 4 && x.status >= 302) { // file does not exist
UPDATE: By the way - I put in dummy files for August through December and it works OK, so this can be a workaround if I can't get the script working. I have removed them for now, as it would be great if I could get it functioning correctly.
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
I forgot about 304 being a valid entry, but thats not the problem !
The 302 redirects to a 404, but due to the way your server is set-up it is being considered 'cross-domain" so the fetch script folds
Try this fix instead:
If that doen't work it needs someone with a better understanding than me of ajax calls I'm afraid 
The 302 redirects to a 404, but due to the way your server is set-up it is being considered 'cross-domain" so the fetch script folds
Try this fix instead:
Code: Select all
if((x.readyState == 4 && x.status >= 400) || x.status == 302) { // file does not exist
......................Imagine, what you will KNOW tomorrow !
- mcrossley
- Posts: 14384
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
The problem is the the XMLHttpRequest returns a status = 0 to the redirect (which is the 302). So I think you will have to test for that instead?
Edit: added missing brace!
Code: Select all
if(x.readyState === 4 && (x.status === 400 || x.status === 0)) { // file does not exist
Last edited by mcrossley on Mon 02 Jul 2012 6:07 pm, edited 1 time in total.
-
hystrix
- Posts: 8
- Joined: Thu 29 Dec 2011 4:51 pm
- Weather Station: Fine offset
- Operating System: Windows 7
- Location: Somerset, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Many thanks to you and beteljuice - I have finally got it working!....once I had added the missing bracketmcrossley wrote:The problem is the the XMLHttpRequest returns a status = 0 to the redirect (which is the 302). So I think you will have to test for that instead?
Code: Select all
if(x.readyState === 4 && (x.status === 400 || x.status === 0) { // file does not exist
Code: Select all
if(x.readyState === 4 && (x.status === 400 || x.status === 0)) { // file does not exist- mcrossley
- Posts: 14384
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Doh!hystrix wrote:..once I had added the missing bracket![]()
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Thanks Mark, although I don't understand it 
Edit: why === (logic test), and where's >= 400 gone ?
Edit: why === (logic test), and where's >= 400 gone ?
......................Imagine, what you will KNOW tomorrow !
- mcrossley
- Posts: 14384
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Just good practice, you should always use the exactly equals === unless there is a good reason to use the 'equivalent' == comparison to avoid getting caught by auto-casting issues.beteljuice wrote:Thanks Mark, although I don't understand it
Edit: why === (logic test)
I just took your original codebeteljuice wrote:and where's >= 400 gone ?
Code: Select all
if(x.readyState == 4 && x.status == 400) { // file does not existI guess that really should be >== 400, or even just replace the whole lot with
Code: Select all
if(x.readyState === 4 && x.status !== 200)-
glenn.vadney
- Posts: 6
- Joined: Sat 22 Dec 2012 4:54 am
- Weather Station: Ambient Weather WS-2080
- Operating System: Windows 7 Home Premium
- Location: Fallon, Nevada, USA
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Can anyone help me and tell me what I'm doing wrong........ why the NOAA report won't display in columns ?
http://webpages.charter.net/cgvad1/noaa.htm
Thanks,
Glenn
http://webpages.charter.net/cgvad1/noaa.htm
Thanks,
Glenn
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
The only problem that I can see at this moment in time is that you 'neatened up' the code - which stuffs the first line in the <pre> section of the report
Should be:
This bit <!-- Report displays here --><span id="theReport"></span> MUST be at the start of the line.
Should be:
Code: Select all
<pre>
<!-- Report displays here --><span id="theReport"></span>
</pre>
......................Imagine, what you will KNOW tomorrow !
-
glenn.vadney
- Posts: 6
- Joined: Sat 22 Dec 2012 4:54 am
- Weather Station: Ambient Weather WS-2080
- Operating System: Windows 7 Home Premium
- Location: Fallon, Nevada, USA
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Thanks Beteljuice............ tried that and it moved the text all the way to the left but still no columns.............
http://webpages.charter.net/cgvad1/noaa.htm
Glenn
http://webpages.charter.net/cgvad1/noaa.htm
Glenn
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Not sure what you mean ?
There are no columns in the report itself - just character spacing.
There are no columns in the report itself - just character spacing.
As far as I can see the report and it's nav menu look like everyones elses, are you seeing something different ?NOAA Style Reports:
The word Style is IMPORTANT - these are NOT NOAA reports !
It also means that the layout is 'fixed' and is meant to look like the old teleprinter output.
This is the way the software(s) have created them and is nothing to do with the script !
......................Imagine, what you will KNOW tomorrow !
-
gemini06720
- Posts: 1700
- Joined: Mon 10 Aug 2009 10:16 pm
- Weather Station: No weather station
- Operating System: No operating system
- Location: World...
Re: JavaScript 'Viewer' of Cumulus generated NOAA style repo
Glenn, the only problem I can see with your page is that the display of the report is too large (width wise) for the space available within the white portion of the page - you might have to adjust some of the CSS properties (unfortunately, I cannot guide you on that 'adventure' as I do not use the 'Sunny Weather' template set). May I suggest that you contact Jacques Desroches (the designer of those templates) for some assistance.