Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

Live Updates on Webpage (do I need Ajax)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Hi all,

Trying to do a few updates to my website.
I'm not sure where to start.

I'd like to get some of the tables updating without having to refresh the pages.

I think I need to use Ajax to get this working, and the. Update pull the values from a variables file that have been uploaded.

I've tried to work our how to do that on some php schools but can't really make head non tail of it.

What I'm trying to do is have a table called.

Current Temp. XXXX. Updated at XXXX

And then get these values change as the real-time text is updated.

I know the Saratoga template do it, but I like to try and do one myself.

Any pointers pleas, and how many files do I need.

Is it a Webpage File
A Variable File
script

Or is more required?

Thanks.

Steve.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

yeah use this smb_ajax.js

look on my page

https://www.davisworthing.co.uk/

if u cant do it let me know i see if i have some time to help you
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Thanks I'll give that a try.

I'm not the best at coding.
I'm sure if I can get one to update I'll be halfway there.

:)
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

Yh u should be fine it only span I'd class
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Thanks.

Did you get rid of the Tool Tips by the way on the Air Quality?
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

Yh thank I remove the divs from it and it gone thank you for that !!
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

That was about my limit.

I'm already stuck on this one as o seem to have an error on the Java script.


I've copied my index.php to index2.php
Which should run the scripts and just change the Current Wind Div.

That's failing so back to drawing board for me.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

If u want me to do one for u to get you start it i can help u if u give me ur ftp details but not on here in pm I get one set up for u so u can see how it look
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

I'm think I'm nearly there but just getting an Error calling the code.

I'm getting the folloiwing Error

Code: Select all

index2:329 Uncaught ReferenceError: initialize is not defined
But I can't see where I've gone wrong

Code: Select all

script type="text/javascript">
//<![CDATA[
			initialize('cumulus.xml',4);
				// ]]>
			</script> 	
I found this Threats as well
viewtopic.php?t=17540

But still not sure where this Error is.
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Well I'#ve created a very basic page called egg.php

And that one is working.
So I've probably got a comma in the wrong place somewhere...
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

Send me the link to ur test site
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

i somehow missed calling the smb_ajax.js

Adding it into header.php which is called and it's now working.

Just need to add the TAGS now.

Thank for the Help!

https://cm2weather.co.uk/egg.php
Last edited by SJG1976 on Mon 03 Jan 2022 8:22 pm, edited 3 times in total.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by dazza1223 »

No worries 👍
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
SJG1976
Posts: 365
Joined: Wed 21 Dec 2011 11:04 am
Weather Station: Davis WLL, with Airlink
Operating System: Raspberry Pi3 MX on USB Drive
Location: Glemsford, Suffolk
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by SJG1976 »

Still doing some expirementinf on WebTags and XML Files.

I've now got some working.

However on an Some Airqiality Tags.

I have the now readings working in a table, but the 1hr 3hr and 24hr don't display any values.

I checked the XML file and the data is there, and all the TAG Names are correct.

Is there a limit on the number of updates that can be done on a page from an XML File?

Thanks Steve.
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Live Updates on Webpage (do I need Ajax)

Post by Mapantz »

There shouldn't be a limit, or at least one you would surpass.

Can you post both your XML tags and the ID codes you're calling them with..?
Image
Post Reply