New at javascript whats wrong with the following script <SCRIPT LANGUAGE="JavaScript"> // MY FORECAST var T ='Falling' //'~~WEBBARTRND~~' // TREND var P ='29.75' //'~~WBNBAROMTR~~' // PRESSURE var D ='87' //'~~WBNWINDGSD~~' //WIND DIRECTION DEGREES var A if (D >= '214' && D <='326' && P >='30.10' && P <= '30.20' && T == 'Steady'); A = "Fair with little temp. change for next 2 days" if (D >= '214' && D <='326' && P >='30.10' && P <= '30.20' && T == 'Rising'); A = "Fair followed by rain in 2 days" if (D >= '214' && D <='326' && P >='30.20' && T == 'Steady'); A = "Continued fair with little temp. change" if (D >= '214' && D <='326' && P>= '30.20' && T == 'Falling'); A = "Slowly rising temp; fair for 2 days" if (D >= '124' && D <='191' && P >='30.10' && P <='30.20' && T == 'Falling'); A = "Rain within 24 hours" if (D >= '124' && D <='191' && P >='30.20' && T == 'Falling'); A = "Wind rising in force; rain in 12 - 24 hours" if (D >= '34' && D <='146' && P >='30.10' && P <='30.20' && T == 'Falling'); A = "Rain in 12 - 18 hours " if (D >= '34' && D <='101' && P >='30.10' && T == 'Falling'); A = "Rain (snow) within 24 hours in winter " if (D >= '34' && D <='101' && P <='30.10' && T == 'Falling'); A = "Rain (snow), wind " if (D >= '34' && D <='146' && P <='30.00' && T == 'Falling'); A = "Steady rain for 1 - 2 days" if (D >= '169' && D <='236' && P <='30.00' && T == 'Rising'); A = "Clearing within a few hours then fair" if (D >= '79' && D <='191' && P <='29.80' && T == 'Falling'); A = "Severe storm imminent, clearing in 24 hrs" if (D >= '0' || D <='101' && P <='29.80' && T == 'Falling'); // Set for this A = "Severe northeast gale, rain (snow)" if (D >= '0' && D <='281' && P <='29.80' && T == 'Rising'); A = "Clearing and colder" if (D >= '281' && D <='360' && P <='29.80' && T == 'Rising'); A = "Clearing and colder" if (D >= '102' && D <='123' && P <='30.03' && T == 'Steady'); A = "Clearing and colder" document.write(A); </SCRIPT>
You need to remove the semi-colons from your 'if' clause. They should be at the end of your 'A=bla bla' lines. You're also comparing strings which won't give you the result you were expecting. Use 'else if ...' so that the processing stops when a match is found.
For god sake. Use a switch/case-syntax.... http://www.devguru.com/technologies/javascript/11483.asp Atleast read a book about the basics in programming syntax before trying it online.. christ..