Jump to content

s_avinash_s

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by s_avinash_s

  1. Hi I have a table as shown https://www.w3schools.com/code/tryit.asp?filename=FW45FU4STHOR 1.Instead of using align=center or right i need to keep the table at 60% of width of web page. 2.I want to make it inline instead of next line. I tried with display: inline-block; but has no effect 3. i need to update dynamic data in paramter1 to 5.am getting the content changes in pro_parameter1 but how to update in my table <p id="pro_parameter1"></p> <script> var currentUsedFont; function pro_parameter1() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("pro_parameter1").innerHTML=this.responseText; document.getElementById("pro_parameter1").style.fontSize="25px"; } }; xhttp.open("GET", "pro_parameter1.txt", true); xhttp.send(); } setInterval(pro_parameter1(), 1000); How to do it. How to proceed
  2. Hi Dsonesuk and JMRKER Thanks for the reply. My code is as below <p class = "modify" id="error_pos1"></p> <p class = "modify" id="error_pos2"></p> <p class = "modify" id="error_pos3"></p> <p class = "modify" id="error_pos4"></p> <p class = "modify" id="error_pos5"></p> <p class = "modify" id="error_pos6"></p> <p class = "modify" id="error_pos7"></p> <p class = "modify" id="error_pos8"></p> <script> function error_1() { var x1; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { } else { x1 = this.responseText; if (x1 == 0 ) { document.getElementById("error_pos1").innerHTML = "Error for temp1"; } } } }; xhttp.open("GET", "error_val1.txt", true); xhttp.send(); } setInterval(error_1(), 5000); function error_2() { var x2; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { } else { x2 = this.responseText; if (x2 == 0 ) { document.getElementById("error_pos2").innerHTML = "Error for temp2"; } } } }; xhttp.open("GET", "error_val2.txt", true); xhttp.send(); } setInterval(error_2(), 5000); ...... actually am monitoring the error case every 5 seconds through ajax. And also here i have mainly x2 = this.responseText; if (x2 == 0 ) { document.getElementById("error_pos2").innerHTML = "Time Not Set"; } else part am not checking.only if it goes inside this condition then only Error should appear on first line. Similarly for all the 8 errors also. Which ever error is latest, it should be displayed on first line and others should be moved down. Please suggest how to do it
  3. Hi I will be getting the data every 5 seconds using ajax. whenever error data comes i need to display it . So using insertbefore() or the code above mentioned will be fine but with little modifications. 1. In above code, instead of radio buttons, Whichever error data comes i need to display.how to do it please suggest 2.I have tried with insertbefore() https://www.w3schools.com/code/tryit.asp?filename=FW30QQZS675R Here i need to limit the data to 8. also how to get the value using ajax and display instead of water as being displayed
  4. Hi By using below style i can able to create two boxes which are side by side #rcorners3 { border-radius: 25px; border: 4px solid #92a8d1; padding: 20px; width: 755px; height: 150px; } If i keep <br> or my text exceeds the box size , the other box shifts down. But i need to use <br> inmy code. How to proceed ,Please suggest
  5. Hi, I am using a following code. <p id="error_pos1a"></p> <script> function error_1() { var x; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 ) { if(xhttp.status == 0) { } else { document.getElementById("error_pos1a").innerHTML = this.responseText; x= document.getElementById("error_pos1a").innerHTML; if (x == 0 ) { document.getElementById("error_pos1a").innerHTML = "Tube Not Full"; } else { document.getElementById("error_pos1a").innerHTML = "Tube Full"; } } } }; xhttp.open("GET", "error_val1.txt", true); xhttp.send(); } setInterval(error_1(), 1000); </script> Actually i need a clarification for " x= document.getElementById("error_pos1a").innerHTML; " whether x gets the correct value by this
  6. Hi I have a web page.when i load it in other monitor. GUI gets changed. How to keep it fixed in all monitors irrespective of size
  7. Hi At first both leds shown, then only yellow led. with disconnected case, only disconnected text is printed.no yellow led is shown after that https://www.w3schools.com/code/tryit.asp?filename=FW28CGRYIQBC
  8. Hi I created <p> with id and now i can see it once at the starting, may be due p with id creation. disconnected is always visible. Now after disconnected is shown , i want led to be glown continously <p id="led-yellow"></p> <p id="ping1"></p> <script> function ping() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; document.getElementById("led-yellow").style.visibility = "hidden"; } else { document.getElementById("ping1").innerHTML = "Connected"; document.getElementById("led-green").style.visibility = "hidden"; } } }; xhttp.open("GET", "ping.txt", true); xhttp.send(); } setInterval("ping()", 1000); </script>
  9. Hi i am not getting exactly why this visibility option is needed. I tried some thing like https://www.w3schools.com/code/tryit.asp?filename=FW25NN8UM79R But not working..only disconnected is coming as before
  10. Hi Dsonesuk, Thanks for the reply. But i didn't get exactly how to proceed. Actually led data is in div with class, how to get it in id. Can you share any example similar
  11. Hi I have got a sample code for LED change. https://www.w3schools.com/code/tryit.asp?filename=FW1SQNHXYORW How to get led change in below conditions using div as shown above. if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; document.getElementById("ping1").style.color = "red"; } else { document.getElementById("ping1").innerHTML = "Connected"; document.getElementById("ping1").style.color = "green"; } In above if status is 0 , i need to glow yellow LED else Green .How to do it. Please help
  12. Hi I have got a sample code for LED change. https://www.w3schools.com/code/tryit.asp?filename=FW1SQNHXYORW How to get led change in below conditions using div as shown above. if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; document.getElementById("ping1").style.color = "red"; } else { document.getElementById("ping1").innerHTML = "Connected"; document.getElementById("ping1").style.color = "green"; } In above if status is 0 , i need to glow yellow LED else Green .How to do it. Please help
  13. Hi I have a option of 8 errors in my web page. Whenever the latest error comes it should be at the top of list, the one which was earlier at top should shift to next line. the second line error should shift to third line and so on. Is there any idea to proceed with this or an example ?
  14. Hi Thanks for the reply. Now i can able to move the slider. I need all in single line but slider is going to next line. I tried below code but its not working <style> .slide { display: inline-block; } </style> <br><br> <strong><font size="5">Current O/P 1:&emsp;&emsp;&emsp;</strong></font> <form> <div class = slide> 4 mA<input id="currentoutput1" type="range" min="4" max="20" step="0.01" oninput="recieved_current_output_1.value=currentoutput1.value" >20 mA <input id="recieved_current_output_1" min="4" max="20" oninput="currentoutput1.value=recieved_current_output_1.value" > </div> </form> Please suggest
  15. Hi When i try to change to div, it changes everything which becomes more unusual. So i only made p element margin as 0 , then first row becomes proper.now other part becomes uneven. I have attached a the uneven part of boxes. <div id="flowvalues" class="tabcontent"> <style> span { background-color: lightgrey; width: 800px; border-style: solid; border-color: #92a8d1; display: inline-block; } p.modify { display: inline-block; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; } </style> </head> <body> <span> <strong><font size="5">Mass Flow Rate</strong></font> &emsp;&emsp;&emsp;:&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="demo2"></p> <script> var currentUsedFont; function massflow_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo2").value = this.responseText; document.getElementById("mass_func").value = this.responseText; } }; xhttp.open("GET", "massflow_val.txt", true); xhttp.send(); } setInterval(massflow_val, 1000); </script> <input type="text" id="mass_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="demo3"></p> <script> function massunit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo3").innerHTML = this.responseText; } }; xhttp.open("GET", "massunit.txt", true); xhttp.send(); } setInterval(massunit(), 1000); </script> <br> <br> <strong><font size="5">Volume Flow Rate</strong></font> &emsp;&nbsp;&nbsp;:&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="demo5"></p> <script> function volumeflow_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo5").value = this.responseText; document.getElementById("vol_func").value = this.responseText; } }; xhttp.open("GET", "volumeflow_val.txt", true); xhttp.send(); } setInterval(volumeflow_val(), 1000); </script> <input type="text" id="vol_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="demo6"></p> <script> function volumeflowunit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo6").innerHTML = this.responseText; } }; xhttp.open("GET", "volumeflowunit.txt", true); xhttp.send(); } setInterval(volumeflowunit(), 1000); </script> <br> <br> <strong><font size="5">Density</strong></font> &emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;: &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="demo8"></p> <script> function densityflow_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo8").value = this.responseText; document.getElementById("den_func").value = this.responseText; } }; xhttp.open("GET", "densityflow_val.txt", true); xhttp.send(); } setInterval("densityflow_val()", 1000); </script> <input type="text" id="den_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="demo9"></p> <script> function densityflowunit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo9").innerHTML = this.responseText; } }; xhttp.open("GET", "densityflowunit.txt", true); xhttp.send(); } setInterval("densityflowunit()", 1000); </script> <br><br> </span> <span > <strong><font size="5">Totaliser 1</strong></font> &emsp;&emsp;&emsp;:&emsp;&emsp;&emsp;&nbsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="totaliser1"></p> <script> function totaliser1_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("totaliser1").value = this.responseText; document.getElementById("totaliser1_func").value = this.responseText; } }; xhttp.open("GET", "totaliser1_val.txt", true); xhttp.send(); } setInterval(totaliser1_val(), 1000); </script> <input type="text" id="totaliser1_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="totaliser1unit"></p> <script> function totaliser1_unit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo9").innerHTML = this.responseText; } }; xhttp.open("GET", "totaliser1_unit.txt", true); xhttp.send(); } setInterval(totaliser1_unit(), 1000); </script> hhhh <br> <br> <strong><font size="5">Totaliser 2</strong></font> &emsp;&emsp;&emsp;:&emsp;&emsp;&emsp;&nbsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="totaliser2"></p> <script> function totaliser2_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("totaliser2").value = this.responseText; document.getElementById("totaliser2_func").value = this.responseText; } }; xhttp.open("GET", "totaliser2_val.txt", true); xhttp.send(); } setInterval(totaliser2_val(), 1000); </script> <input type="text" id="totaliser2_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="totaliser2unit"></p> <script> function totaliser2_unit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("totaliser2unit").innerHTML = this.responseText; } }; xhttp.open("GET", "totaliser2_unit.txt", true); xhttp.send(); } setInterval(totaliser2_unit(), 1000); </script> gggg <br> <br> <strong><font size="5">Temperature</strong></font> &emsp;&nbsp;&nbsp;: &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <p class = "modify" id="demo11"></p> <script> function temp_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo11").value = this.responseText; document.getElementById("temp_func").value = this.responseText; } }; xhttp.open("GET", "temp_val.txt", true); xhttp.send(); } setInterval(temp_val(), 1000); </script> <input type="text" id="temp_func" size ="7" style="border: 2px solid black;font-size:35pt;"> <p class = "modify" id="demo12"></p> <script> function tempunit() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo12").innerHTML = this.responseText; } }; xhttp.open("GET", "tempunit.txt", true); xhttp.send(); } setInterval("tempunit()", 1000); </script> <br> <br> </span> <span> <style> input[type=range] { -webkit-appearance: none; width: 55%; border-radius: 8px; height: 7px; border: 1px solid #bdc3c7; background-color: #92a8d1; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; } </style> <br><br> <strong><font size="5">Current O/P 1:&emsp;&emsp;&emsp;</strong></font> <form> <div> 4<input id="currentoutput1" type="range" min="4" max="20" step="0.01" oninput="recieved_current_output_1.value=currentoutput1.value" >20 <input id="recieved_current_output_1" type="number" value="100" min="0" max="200" oninput="rangeInput.value=recieved_current_output_1.value" > </div> </form> <br> <br> <br> <strong><font size="5">Frequency O/P 1:&nbsp;&nbsp;&emsp;</strong></font> 0 Hz<input type="range" id="frequencyoutput1" min="0" max="10000" step="0.01">10000 Hz <p id="frequency_output_val_1"></p> <script> function frequency_output_1() { var x = document.getElementById("frequencyoutput1").value; document.getElementById("frequency_output_val_1").innerHTML = x; } setInterval(frequency_output_1,1000); </script> <br> <br> </span> <span> <br><br> <strong><font size="5">Current O/P 2:&emsp;&emsp;&emsp;</strong></font> 4 mA<input type="range" id="currentoutput2" min="4" max="20" step="0.01" >20 mA <p id="current_output_val_2"></p> <script> function current_output_2() { var x = document.getElementById("currentoutput2").value; document.getElementById("current_output_val_2").innerHTML = x; } setInterval(current_output_2,1000); </script> <br> <br> <br> <strong><font size="5">Frequency O/P 2:&nbsp;&nbsp;&emsp;</strong></font> 0 Hz<input type="range" id="frequencyoutput2" min="0" max="10000" step="0.01" >10000 Hz <p id="frequency_output_val_2"></p> <script> function frequency_output_2() { var x = document.getElementById("frequencyoutput2").value; document.getElementById("frequency_output_val_2").innerHTML = x; } setInterval(frequency_output_2,1000); </script> <br> <br> </span> <br> <style> #rcorners3 { border-radius: 25px; border: 4px solid #92a8d1; padding: 20px; width: 755px; height: 150px; } </style> <span id="rcorners3" > <strong><font size="5">Alerts / Errors</strong></font> </span> <span id="rcorners3" > <strong><font size="5">IO Connections</strong></font> </span> </div> Please suggest
  16. Hi I have a range slider which changes when we move the slider or when we enter the value as shown in below example. https://www.w3schools.com/code/tryit.asp?filename=FVXOWJ0Q97E0 But what am trying is, Instead of entering the value manually i need to get it from server . Based on the value received from server , slider should automatically move from one place to other. I just tried like below.but it does not work. I am not getting how to do this <form> <div> <input id="currentoutput1" type="range" min="4" max="20" step="0.01" oninput="recieved_current_output_1.value=currentoutput1.value" > <input id="recieved_current_output_1" type="number" value="10" min="4" max="20" oninput="rangeInput.value=recieved_current_output_1.value" > </div> </form> <p class = "modify" id="current_output_val_1"></p> <script> var recieved_current_output_1; function current_output_1() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("current_output_val_1").innerHTML = this.responseText; recieved_current_output_1= document.getElementById("current_output_val_1").innerHTML; } }; xhttp.open("GET", "current_output_1.txt", true); xhttp.send(); } setInterval(current_output_1,1000); </script> Please suggest
  17. Hi I am trying to make two equal boxes in my code but there is some mismatch happening between both as shown in attached image. Am using span and p in my code.Please suggest <style> span { background-color: lightgrey; width: 800px; border-style: solid; border-color: #92a8d1; display: inline-block; } p.modify { display: inline-block; } </style>
  18. Hi I have a below code which works perfectly when Ethernet cable is connected or disconnected. <p id="ping1"> </p> <script> function ping() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; document.getElementById("ping1").style.color = "red"; } else { document.getElementById("ping1").innerHTML = "Connected"; document.getElementById("ping1").style.color = "green"; } } }; xhttp.open("GET", "ping.txt", true); xhttp.send(); } setInterval(ping(), 1000); </script> Now i want to modify the below code if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; document.getElementById("ping1").style.color = "red"; } else { document.getElementById("ping1").innerHTML = "Connected"; document.getElementById("ping1").style.color = "green"; } with a red button for disconnected and with green for connected.(button like small dot ). I got the below code for dots creation just need to change a color.But how to use in my code for xhttp.status == 0 and else part Please suggest a way to do it
  19. Hi I want to use p as inline only for one function or in one script.and in other parts it should be normal. How to proceed with this.I tried like below but it changes everywhere p { display:inline; }
  20. Hi When i remove the below lines currentUsedFont = document.getElementById("demo2").style.fontSize; newtext(); That time i can get font and contents at original place only. Is there any problem the way am calling the above 2 lines. xhttp.open("GET", "abc.txt", true); The above argument abc.txt file has no content.it is used as resource to receive at server side and get data from there
  21. Hi But for me , nothing is getting displayed. Not getting any value
  22. Hi Yes ,after removing quotes and parenthesis also.It does not help. How to make it work...
  23. Hi Changed after currentusedfont. Still the same issue only <p id="demo2"></p> <script> var currentUsedFont; function abc_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo2").innerHTML=this.responseText; document.getElementById("demo2").style.fontSize="25px"; currentUsedFont = document.getElementById("demo2").style.fontSize; newtext(); } }; xhttp.open("GET", "abc.txt", true); xhttp.send(); } setInterval("abc_val()", 1000); </script> other part: <p id="new_demo"></p> <script> function newtext() { document.getElementById("new_demo").innerHTML=currentUsedFont; } </script>
  24. Hi I have modified like below to make it as global variable. But still am not getting any data at both sides <script> var currentUsedFont; function() { .... .... document.getElementById("demo2").innerHTML=this.responseText; document.getElementById("demo2").style.fontSize="25px"; currentUsedFont = document.getElementById("demo2").style.fontSize; } </script> other part: <p id="new_demo"></p> <script> function newtext() { document.getElementById("new_demo").style.fontSize = currentUsedFont; } setInterval("newtext()", 1000); </script>
  25. Hi I have tried like below code. Am not getting the value. In default case also, am not getting the value. <p id="demo2"></p> <script> function abc_val() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo2").innerHTML=this.responseText; var currentUsedFont = document.getElementById("demo2").innerHTML; } }; xhttp.open("GET", "abc.txt", true); xhttp.send(); } setInterval("abc_val()", 1000); </script> Other code where it is used: <p id="new_demo"></p> <script> function newtext() { document.getElementById("new_demo").innerHTML=currentUsedFont; } setInterval("newtext()", 1000); </script> Any thing wrong Please suggest
×
×
  • Create New...