Merge branch 'master' of git.2li.ch:Nebucatnetzer/ibz

This commit is contained in:
Andreas Zweili 2017-06-24 10:55:41 +02:00
commit 719e55a06d
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<script type="text/javascript" src="greeting.js"></script>
<title>JavaScript</title>
</head>
<body onload="greetUser();">
<h1>JavaScript</h1>
</body>
</html>

View File

@ -0,0 +1,16 @@
function greetUser() {
var currentTime = new Date();
var t = currentTime.getHours();
if (t >= 6) {
greeting = "Gute Nacht!";
} else if (t < 6 && t > 10) {
greeting = "Guten Morgen!"
} else if (t < 10 && t > 17) {
greeting = "Guten Tag"
} else {
greeting = "Guten Abend!"
}
alert(greeting);
}

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<script type="text/javascript" src="return_month.js"></script>
<title>JavaScript</title>
</head>
<body onload="returnMonth();">
<h1>JavaScript</h1>
</body>
</html>

View File

@ -0,0 +1,8 @@
function returnMonth() {
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November",
"December"]
var currentDate = new Date();
var m = monthNames[currentDate.getMonth()];
alert(m);
}