Cu acest script puteti afla ziua din saptamana corespunzatoare oricarei date cuprinse intre 1900 si 2050
Puteti testa acest script in exemplul de mai jos.
Pentru a adauga acest script intr-o pagina web:
1. Adaugati in documentul HTML, in sectiunea HEAD, urmatorul script.
<script type="text/javascript">
<!--
// Script gratuit
var month = new Array("Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie");
var startyear = "1900"; // Primul an care poate fi ales
var endyear = "2050"; // Ultimul an care poate fi ales
function ziua() {
var month = document.datazilei.ziluna.options[document.datazilei.ziluna.selectedIndex].value;
var day = document.datazilei.nrzi.options[document.datazilei.nrzi.selectedIndex].value;
var year = document.datazilei.birthyear.options[document.datazilei.birthyear.selectedIndex].value;
var nrzi = new Date(year,month,day);
var ziua = nrzi.getDay();
var weekday = new Array("Duminica", "Luni", "Marti", "Miercuri", "Joi", "Vineri", "Sambata");
alert("Data corespunde zilei de " + weekday[ziua]);
}
//-->
</script>
<form name="datazilei">
<div align="center"><center><table bgcolor="#fefefe" border="2" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="center"><font face="verdana, arial" size="-1">Alege data dorita</font></td>
</tr>
<tr>
<td align="center">
<select name="ziluna" size="1">
<script type="text/javascript">
for(var i=0;i<month.length;i++)
document.write("<option value="+i+">"+month[i]+"</option>");
</script>
</select></td>
<td align="center">
<select name="nrzi" size="1">
<script type="text/javascript">
for(var j=1;j<32;j++)
document.write("<option value="+j+">"+j+"</option>");
</script>
</select></td>
<td align="center">
<select name="birthyear" size="1">
<script type="text/javascript">
for(var k=startyear;k<endyear;k++)
document.write("<option value="+k+">"+k+"</option>");
</script>
</select></td>
</tr>
</table>
</center></div><div align="center"><center><br>
<input value="Afla ziua" onclick="ziua()" type="button">
</center></div>
</form>
<div>Web Programming and Development</div>
h2 { text-decoration: underline; }
function someFunction() { alert("CoursesWeb.net"); } setTimeout("someFunction()", 2000);
$food =["fruits" =>["banana", "mar"), "veggie" =>["ceapa", "rosie")); $nr_food = count($food, 1); echo $nr_food; // 6
The child will haven't played by Sunday. - Copilul nu s-ar fi jucat pana duminica.
Él no habrá contado el cuento. - El nu ar fi spus povestea.