Page 3 of 3
Re: Live Updates on Webpage (do I need Ajax)
Posted: Wed 26 Jan 2022 3:58 pm
by SJG1976
Thanks Dazza,
Your Using
As an Example in your XML File.
I've not tried that.
When I tried
Code: Select all
<item name="AirLinkPm2p5_3hrOut">
This is when my XML didn't update the HTML Pages. Not sure if it's the Underscore that makes a difference?
Re: Live Updates on Webpage (do I need Ajax)
Posted: Wed 26 Jan 2022 6:49 pm
by dazza1223
so it look like it there in the xml
<item name="AirLinkPm2p53hrOut">
<value><#AirLinkPm2p5_3hrOut></value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
put this like how i put in as ur not calling the span and ive done it i just removed the _ line and it working but like this
<td><span class="ajax" id="AirLinkPm2p53hrOut"></td>
Re: Live Updates on Webpage (do I need Ajax)
Posted: Wed 26 Jan 2022 6:55 pm
by Mapantz
I think it's a waste of bandwidth putting character data and descriptions in to the XML file, they aren't needed.
Just manually put the units at the end of the id, between the span and table data cell
Re: Live Updates on Webpage (do I need Ajax)
Posted: Thu 27 Jan 2022 8:47 pm
by SJG1976
Thanks Dazza,
I'll give that a go tomorrow and try with the Units in.
Will see if it processes them correctly.
Thanks.
Steve.
Re: Live Updates on Webpage (do I need Ajax)
Posted: Fri 28 Jan 2022 1:31 pm
by SJG1976
dazza1223 wrote: ↑Wed 26 Jan 2022 6:49 pm
so it look like it there in the xml
<item name="AirLinkPm2p53hrOut">
<value><#AirLinkPm2p5_3hrOut></value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
put this like how i put in as ur not calling the span and ive done it i just removed the _ line and it working but like this
<td><span class="ajax" id="AirLinkPm2p53hrOut"></td>
I only managed to get it to processes with the following.
Code: Select all
<item name="AirLinkPm2p5NowcastOut"> <value> <#AirLinkPm2p5_NowcastOut> </value> <unit><![CDATA[ µm]]> </unit> <class>dynamic</class> <description> </description> </item>
Re: Live Updates on Webpage (do I need Ajax)
Posted: Fri 28 Jan 2022 2:30 pm
by dazza1223
ok so my trick work then ?
Re: Live Updates on Webpage (do I need Ajax)
Posted: Fri 28 Jan 2022 2:35 pm
by dazza1223
you need to remove the _ that and in the index page u need to call it ie like
<td><span class="ajax" id="AirLinkPm2p51hrOut"></span></td>
cos for some reason the xml doesn't like the _ so u have to put as the name as like this
old...
<item name="AirLinkPm2p5_1hrOut">
to
<item name="AirLinkPm2p51hrOut">
Code: Select all
</item>
<item name="AirLinkPm2p5_1hrOut">
<value>11.7</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>last hour average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p5_3hrOut">
<value>15.1</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p5_24hrOut">
<value>17.0</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 24 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p5_NowcastOut">
<value>15.3</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>The 24 hour ""nowcast"" weighted average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count"</description>
</item>
to like this
Code: Select all
</item>
<item name="AirLinkPm2p51hrOut">
<value>11.7</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>last hour average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p53hrOut">
<value>15.1</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 3 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p524hrOut">
<value>17.0</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>Last 24 hours average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count</description>
</item>
<item name="AirLinkPm2p5NowcastOut">
<value>15.3</value>
<unit><![CDATA[ C2 b5]]></unit>
<image></image>
<class>dynamic</class>
<description>The 24 hour ""nowcast"" weighted average particulate matter of 2.5 <![CDATA[ C2 b5]]>.. or less.. count"</description>
</item>
Re: Live Updates on Webpage (do I need Ajax)
Posted: Fri 28 Jan 2022 3:09 pm
by Mapantz
I'm using the underscore character in my XML without any problems..