-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.html
44 lines (40 loc) · 1.16 KB
/
result.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Widerstandsrechner</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 50px;
}
h1 {
color: #333;
text-align: center;
}
p {
color: #666;
text-align: center;
}
</style>
</head>
<body>
<h1>Widerstandsrechner</h1>
<script>
// URL-Parameter auslesen
const urlParams = new URLSearchParams(window.location.search);
const resistance = urlParams.get('R');
const tolerance = urlParams.get('T');
const tempCoefficient = urlParams.get('tK');
// Text generieren
let text = `Der Widerstand beträgt ${resistance}Ohm, die Toleranz ist ${tolerance}%`;
if (tempCoefficient !== null && parseInt(tempCoefficient) !== 0) {
text += ` und der Temperaturkoeffizient beträgt ${tempCoefficient} ppm`;
}
// Text ausgeben
const outputElement = document.createElement('p');
outputElement.textContent = text;
document.body.appendChild(outputElement);
</script>
</body>
</html>