her
Rank: Fondator Membru din : 10/05/2012 Mesaje : 242 Localitate : Olteni Varsta : 27 Status : Lucrez la forum Steam : N/A Experienta CS : Excelenta Harta preferata : de_perfect_inferno Arma preferata : M4A1, AK47, AWP, Deagle
| Subiect: Tutorial JS - Trow Sam Iul 21, 2012 7:33 am | |
| - Cod:
-
<html> <body> <script type="text/javascript"> var x=prompt("Enter a number between 0 and 10:",""); try { if(x>10) { throw "Err1"; } else if(x<0) { throw "Err2"; } else if(isNaN(x)) { throw "Err3"; } } catch(er) { if(er=="Err1") { alert("Error! The value is too high"); } if(er=="Err2") { alert("Error! The value is too low"); } if(er=="Err3") { alert("Error! The value is not a number"); } } </script> </body> </html> |
|