I notice that one of the changes in going from Build 1086 to 1089 (so it may have happened for any build in between) is that you offer the possibility of presetting the monthlyrecord.htm page to display initially the data relating to the current month, rather than having it always default to January.
However I can't make it work and my knowledge of Javascript isn't up to diagnosing why.
In the <script></script> section you now call changeData(+'<#month>' - 1); (yes, I have removed the // which was commenting-out the line!) which evaluates to changeData(+'04' - 1); in monthlyrecord.htm at the moment. However the page still initially displays January's data.
I wondered whether the syntax of the expression was wrong so I tried an explicit changeData(4); instead and even that doesn't work. This makes me wonder whether the function is even being called at that point. The function does work if it's called by pressing one of the Month buttons - the <input type="button" value="Mar" onclick="changeData(2)"/> code.
Any suggestions?
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
Possible error in updated monthlyrecordT.htm (build 1089)
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Possible error in updated monthlyrecordT.htm (build 1089
Yes, I added the commented-out code, but I forgot to move the script to the end of the document (just before the </body> tag).
Steve
-
martinu
- Posts: 93
- Joined: Wed 01 Jan 2014 7:54 pm
- Weather Station: Davis Vantage Vue
- Operating System: Raspberry Pi: Raspbian Stretch
- Location: Rudston, North Yorkshire
Re: Possible error in updated monthlyrecordT.htm (build 1089
Thanks. That works perfectly.
For the benefit of anyone else who may see this thread and wants to make the code work (before you release it in the next build) the edits that you make to monthlyrecordT.htm are:
1) remove lines 116-118
// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
//changeData(+'<#month>' - 1);
2) insert the following lines immediately before the </body> line (the last-but-one line)
<script>
// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
changeData(+'<#month>' - 1);
</script>
For the benefit of anyone else who may see this thread and wants to make the code work (before you release it in the next build) the edits that you make to monthlyrecordT.htm are:
1) remove lines 116-118
// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
//changeData(+'<#month>' - 1);
2) insert the following lines immediately before the </body> line (the last-but-one line)
<script>
// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
changeData(+'<#month>' - 1);
</script>