Prova in Javascript


Prova in VBScript

 

 

Codice sorgente

 
  <SCRIPT language="javascript">
//###########################################################################
//## Copyright (C) 2005 Ubaldo Pernigo
//## Author Ubaldo Pernigo
//## Support can be obtained from author at http://www.pernigo.com
//## This program is free software. You can redistribute it and/or modify
//## it under the terms of the GNU General Public License as published by
//## the Free Software Foundation; either version 2 of the License.
//###########################################################################
//## date who what
//## 20050225 ubi Prima versione per lezione gruppo potenziamento matematica
//###########################################################################
</script>

<script type="text/vbscript">

function adessooraVB()
ora = hour(time)
minuti = minute(time)
msg = " sono le ore " & ora & ":" & minuti
if ora < 12 then
document.write("Buon giorno!" & msg)
else
document.write("Buon pomeriggio" & msg)
end if
end function

function adessogiornoVB()
d=weekday(date)
select case d
case 1
document.write("Domenica")
case 2
document.write("Lunedý!")
case 3
document.write("Martedý!")
case 4
document.write("Mercoledý!")
case 5
document.write("Giovedý")
case 6
document.write("Venerdý!")
case else
document.write("Sabato")
end select
end function

</script>


<SCRIPT language="javascript">

function adessooraJS(){
var d = new Date()
var ora = d.getHours()
var minuti = d.getMinutes()
var msg = " sono le ore " + ora + ":" + minuti
if (ora < 12)
{
document.write("Buon giorno!" + msg)
}
else
{
document.write("Buon pomeriggio" + msg)
}
}

function adessogiornoJS(){
var d = new Date()
theDay=d.getDay()
switch (theDay)
{
case 1:
document.write("Lunedý")
break
case 2:
document.write("Martedý")
break
case 3:
document.write("Mercoledý")
break
case 4:
document.write("Giovedý")
break
case 5:
document.write("Venerdý")
break
case 6:
document.write("Sabato!")
break
case 0:
document.write("Domenica!!")
break
default:
document.write("Ma che giorno Ŕ oggi?!")
}
}
</script>

</head>
<body>
<h1>Prova in Javascript</h1>
<SCRIPT language="javascript">
adessooraJS();
document.write("<br> Oggi Ŕ ");
adessogiornoJS();
</script>
<hr>
<h1>Prova in VBScript</h1>
<script type="text/vbscript">
adessooraVB()
document.write("<br> Oggi Ŕ ")
adessogiornoVB()
</script>

</body>
</html>