esercizi js

This commit is contained in:
2014-11-30 18:46:24 +01:00
parent b2e9b46742
commit c30036a3bc
11 changed files with 597 additions and 27 deletions

35
js_8.html Normal file
View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
s = prompt("Sito da visitare: 1 - 2 - 3 - 4");
l = null;
if (s && !isNaN(s)){
switch (s){
case "1": l="http://sito1.com";break;
case "2": l="http://sito2.com";break;
case "3": l="http://sito3.com";break;
case "4": l="http://sito4.com";break;
}
if (l)
location.href=l;
}
</script>
</body>
</html>