Code: Select all
<meta http-equiv="refresh" content="100;url=http://192.168.1.22/index.htm"/>
OK, so I got my application working, and I can use Tod's AJAX example to pass strings back to the browser. Now that I have the working reliably, I would like to go that next step which will change a cell in a table colors. In this case, I would like to setup a simple ON / OFF indicator. So, if I were to hypothetically setup a two cell table, with ON in one cell and OFF in the other, I can see both the HTML and the CSS methods for changing the font color and the background, but the question is, how do I write the Javascript that will read the resulting string, and then select the right style to use? Do I use IF/THEN/ELSE, or do I use the JS version of a SWITCH statement (or something else entirely)? Once the "decision" has been made inside the JS, how does that make it back out into the HTML to do the actual style change? Can you assign an HTML element a variable name so that inside the JS, you can setup something like:
If (ajax_string == "ON"){
HTML_element = CSS_ON_Style;
}
Else {
HTML_element = CSS_OFF_Style;
}
Then back in the HTML would you have something like:
Code: Select all
<td height="75" class="HTML_element"><h2><strong><a href="index.htm?91">ON</a></strong></h2></td>
Sorry to sound like quite the novice, but I really am when it comes to this stuff. I appreciate everyone's help with this whole thing!