Ok so I'm trying to monitor and control something with a Pic-web from microchip. I managed to program it all except for one thing. I need to compare two temperatures that it gives me, and if one of them is smaller that the other then a relay need to be activated, if its bigger or equal then another relay must be activated. From what I understood Pic-web updates an xml file (status.xml) then the website (using ajax) takes the values from there and displays them on the web page.
This is the code in my xml file
This is the code for the temperatures
And this is the code I use to display them in my web page
I have almost 0 knoledge of ajax
I tried to compare them with
but it just displays OFF
This is the code in my xml file
Code:
<temp0>~temp~</temp0> <temp2>~tempc~</temp2>
Code:
document.getElementById('temp0').innerHTML = getXMLValue(xmlData, 'temp0');
document.getElementById('temp2').innerHTML = getXMLValue(xmlData, 'temp2');
Code:
<span id="temp0"style="font-weight:normal">?</span> <span id="temp2"style="font-weight:normal">?</span>
I tried to compare them with
Code:
<script type="text/javascript">
if(temp2==temp0) document.write("On".fontsize(4).fontcolor("green"));
else document.write("Off".fontsize(4).fontcolor("red"));
</script>
Comment