In need of some help. I'm working on a project, and can't figure out, how to make a vb/java script work correctly.
The image below is what I'm trying to create. At this point I'm doing it manaully. Someone suggested that I let a script do it for me automatically, which I am trying to do.
I no good with coding, but I tried.
If anyone can help me, please do. I've very limited in my knowledge of scripting, and would greatly appreciate the help. I know there has to be an easy way to do this, but at the moment I'm having a brain cramp trying to figure it out.Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Heat Index</title> <script type="text/javascript"> function (HeatIndex) { var hi=%[wind_chill]deg_f% hi = %[wind_chill]deg_f%; } } displayFlag(hi); } function displayFlag(hi) { var flagDIV = document.getElementById("flag"); var infoDIV = document.getElementById("info"); var text = 'Current Heat Index: ' + hi + '<br />'; if (hi >= 130) { flagDIV.innerHTML = '<img src="./images/flag_blk_extreme_danger.png" alt="Heat Index is Extreme Danger">'; text += '<b>Extreme Danger</b>'; } else if (hi >= 105) { flagDIV.innerHTML = '<img src="./images/flag_red_danger.png" alt="Heat Index is Danger">'; text += '<b>Danger</b>'; } else if (hi >= 90) { flagDIV.innerHTML = '<img src="./images/flag_ylw_extreme_caution.png" alt="Heat Index is Extreme Caution">'; text += '<b>Extreme Caution</b>'; } else if (hi >= 80) { flagDIV.innerHTML = '<img src="./images/flag_grn_caution.png" alt="Heat Index is Caution">'; text += '<b>Caution</b>'; } else { flagDIV.innerHTML = '<img src="./images/flag_default.png" alt="Heat Index is Okay">'; text += '<b>Okay</b>'; } infoDIV.innerHTML = text + infoDIV.innerHTML; } </script> </head> <body bgcolor="#ffffff" onload="HeatIndex"> <div id="flag" style="float:left;"> </div> <div id="info"> <p><a href="" onclick="window.open('./heat_stress.html','heat_stress','width=650,height=550')">Flag Definitions</a></p> </div> </body> </html>![]()




Reply With Quote

Bookmarks