Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"files.autoSave": "afterDelay",
"screencastMode.onlyKeyboardShortcuts": true,
"terminal.integrated.fontSize": 18,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Visual Studio Dark",
"workbench.fontAliasing": "antialiased",
"workbench.statusBar.visible": true
}
"workbench.statusBar.visible": true,
"liveServer.settings.port": 5501
}
40 changes: 23 additions & 17 deletions Kapitel_01_bis_09/code/conditions.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
<!DOCTYPE html>
<html lang="de">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bedingter Code</title>
</head>

<body>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
und klicken anschließend auf <strong>Konsole</strong>.<br>
<script>
if( false ) {
if (false) {
console.log("Dieser Code wird nicht gezeigt.");
}

if( true ) {
if (true) {
console.log("Dieser Code wird angezeigt.");
}

let a = 1;
if ( a == 1 ) {
if (a == 1) {
console.log("a ist 1")
}

let b = 2;
if ( a == 1 && b == 2 ) {
console.log( "a ist 2 und b ist 2" );
if (a == 1 && b == 2) {
console.log("a ist 2 und b ist 2");
}

if ( a == 8 || b == 2 ) {
console.log( "Code in Zeile 32:", a, b );
if (a == 8 || b == 2) {
console.log("Code in Zeile 32:", a, b);
}

if ( a == b ) {
console.log( "a ist b" );
if (a == b) {
console.log("a ist b");
} else {
console.log( "a ist ungleich b");
console.log("a ist ungleich b");
}

if ( a > 0 ) {
console.log( "a ist größer 0" );
if (a > 0) {
console.log("a ist größer 0");
}

let password = prompt( "Bitte geben Sie das Passwort ein:" );
if ( password == "geheim" ) {
document.body.innerHTML="";
document.write( "Dieser Text hier ist geheim.");
let benutzername = prompt("Bitte geben Sie Ihren Benutzernamen ein:");
if (benutzername == "admin") {
let password = prompt("Bitte geben Sie das Passwort ein:");
if (password == "geheim") {
document.body.innerHTML = "";
document.write("Dieser Text hier ist geheim.");
}
}
</script>
</body>

</html>
15 changes: 9 additions & 6 deletions Kapitel_01_bis_09/code/datetime.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<!DOCTYPE html>
<html lang="de">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Datum und Zeit</title>
</head>

<body>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
und klicken anschließend auf <strong>Konsole</strong>.
<script>
let today = new Date();

console.log(
"Es ist "
+ today.getHours() + ":"
+ today.getMinutes().toString().padStart( 2, '0' ) + " Uhr." );
</script>
console.log(
"Es ist "
+ today.getHours().toString().padStart(2, '0') + ":"
+ today.getMinutes().toString().padStart(2, '0') + " Uhr.");
</script>
</body>

</html>
17 changes: 17 additions & 0 deletions Kapitel_01_bis_09/code/hello.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hallo Welt!</title>
</head>

<body>
<script>
let name = prompt("Wie heißen sie?");
alert("Hallo");
</script>
</body>

</html>
6 changes: 3 additions & 3 deletions Kapitel_01_bis_09/code/hello_world.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<body>
<script>
let name = prompt( "Wie heißen Sie? ");
alert( "Guten Tag, " + name );
let name = prompt("Wie heißen Sie? ");

alert("Juten Morgen, " + name);
</script>
</body>

Expand Down
5 changes: 4 additions & 1 deletion Kapitel_01_bis_09/code/numbers.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html lang="de">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zahlen</title>
</head>

<body>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
Bitte öffnen Sie die "Entwicklertools" bzw. "Werkzeuge für Web-Entwickler" mit <strong>Strg + Shift + I</strong>
und klicken anschließend auf <strong>Konsole</strong>.
<script>
let x = 20;
Expand All @@ -25,4 +27,5 @@
console.log("x hat den Wert " + x);
</script>
</body>

</html>
10 changes: 7 additions & 3 deletions Kapitel_01_bis_09/code/strings.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
<!DOCTYPE html>
<html lang="de">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zeichenketten</title>
</head>

<body>
<script>
let prename = "Thomas";
let surname = "Rose";
let x = 20;
let prename = "Hallo";
let surname = "LinkedIn";

// surname = surname * 1;
// surname = surname + 1;

document.write("Guten Tag, " + prename + " " + surname);

console.log( prename.substring( 0, 1 ) + prename.substring( 2, 4 ) );
console.log(prename.substring(0, 1) + surname.substring(1, 1) + surname.substring(0, 8));
</script>
</body>

</html>