error and new record lights
Posted: Mon 07 May 2012 3:50 am
Hello all, I am hoping that somebody may be able to help me with the code for this small problem that I have. I am incorporating red or green lights into a table and that works fine but what I would also like to be able to do is incorporate both red and green lights alongside each other when the condition var x=11 is met. The alternative to not being able to do this is to use a third color for condition 11. After a heck of a lot of experimenting and researching I am still unsuccessful and at a loss. Help would be greatly appreciated.
Thanks in advance.
Alan
<table class="data" width="auto" height="45px" border="0" cellpadding="0" cellspacing="0" align="center">
<td valign="bottom"><script type="text/javascript">
var x=11 <!--<#ErrorLight><#newrecord>/!-->
if (x == "10") {var pictures = "redlight.png";}
if (x == "01") {var pictures = "greenlight.png";}
if (x == "11") {var pictures = "redlight.png";}
{var pictures = "greenlight.png";} (in this arrangement of course only the green light remains active)
if (x == "00") {var pictures = "greenlight.png";hidden}
document.write('<img src="http://home.exetel.com.au/retnuh/weathe ... '+pictures+'"/>');
</script></td>
</table>
Thanks in advance.
Alan
<table class="data" width="auto" height="45px" border="0" cellpadding="0" cellspacing="0" align="center">
<td valign="bottom"><script type="text/javascript">
var x=11 <!--<#ErrorLight><#newrecord>/!-->
if (x == "10") {var pictures = "redlight.png";}
if (x == "01") {var pictures = "greenlight.png";}
if (x == "11") {var pictures = "redlight.png";}
{var pictures = "greenlight.png";} (in this arrangement of course only the green light remains active)
if (x == "00") {var pictures = "greenlight.png";hidden}
document.write('<img src="http://home.exetel.com.au/retnuh/weathe ... '+pictures+'"/>');
</script></td>
</table>