Sir,
i m very new in javascript program...
please help me
my problem is ...
3 different text box showing 3 values (AC current phase difference) like: 130,133,135 in name of R,S,T and all values are changing/upgrading every seconds signal coming from turbine server.
i need java script program calculate 1st which one is greater then minus other 2 from it and calculate maximum value from two new results and show it in webpage and final result must be upgrade after 1 second if R,S,T values change.
i already used this code but it freeze after 1st result....
the R,S,T input box code are written by supplier..
i also used another code with click button but after clicking its show result in next page and result not upgrading in every seconds.
here the code....
i need some modification code which must be show result in main page and upgrade final result after every seconds....
please anybody help me ....
regards
Reply With Quote
i m very new in javascript program...
please help me
my problem is ...
3 different text box showing 3 values (AC current phase difference) like: 130,133,135 in name of R,S,T and all values are changing/upgrading every seconds signal coming from turbine server.
i need java script program calculate 1st which one is greater then minus other 2 from it and calculate maximum value from two new results and show it in webpage and final result must be upgrade after 1 second if R,S,T values change.
i already used this code but it freeze after 1st result....
Code:
<script type="text/javascript">
var R = parseInt(document.all('P3:0:0').innerText);
var S = parseInt(document.all('P3:1:0').innerText);
var T = parseInt(document.all('P3:2:0').innerText);
<!-**here P3:0:0,P3:1:0 & P3:2:0 are the id where inputs coming from server* ->
var TS = Math.abs(T-S);
var TR = Math.abs(T-R);
//** I select here T is always bigger then other two**//
if (TS>TR){ document.write(TS)
}
else { document.write(TR)
}
</script>
the R,S,T input box code are written by supplier..
Code:
<td class="inner" align="left"><div class="value" id="P3:0:0"></div></td> <td class="inner" align="left"><div class="value" id="P3:1:0"></div></td> <td class="inner" align="left"><div class="value" id="P3:2:0"></div></td>
here the code....
Code:
<script type="text/javascript">
function showdiff(){
var R = parseInt(document.all('P3:0:0').innerText);
var S = parseInt(document.all('P3:1:0').innerText);
var T = parseInt(document.all('P3:2:0').innerText);
var TS = Math.abs(T-S);
var TR = Math.abs(T-R);
if (TS>TR){ document.write(TS)
}
else { document.write(TR)
}
}
</script>
<body onload = "showdiff()">
<td class="inner">
<div id="showdiff()" style="height: 1.5em; font-size: 2em; color: red;"></div>
<input type="button" name="showdiff()" id="showdiff()" value="P. diff" onClick="showdiff()"/>
</td>
please anybody help me ....
regards
Reply With Quote
Comment