esercizi js
This commit is contained in:
35
js_8.html
Normal file
35
js_8.html
Normal 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>
|
||||
Reference in New Issue
Block a user