PDCA App
Why did the software engineer quit his job? He didn't get arrays.
以下はJavaScriptで実装したPDCAアプリの例です。セキュリティリスクのあるevalや他のサイトへの遷移、リダイレクトは使用していません。
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PDCA App</title>
<script type="text/javascript">
const phrases = ["P", "D", "C", "A"];
let index = 0;
function updatePhrase() {
const phrase = phrases[index];
document.getElementById("phrase").textContent = phrase;
index++;
if (index >= phrases.length) {
index = 0;
}
}
</script>
</head>
<body>
<h1>PDCA App</h1>
<button onclick="updatePhrase()">Click me!</button>
<p id="phrase"></p>
<p>Why did the software engineer quit his job? He didn't get arrays.</p>
</body>
</html>
```
上記の例では、phrases配列にPDCAの各フェーズの文字列を格納し、updatePhrase関数で画面上の文字列を切り替えています。もしphrases配列に他の文字列を追加したい場合は、単に配列に文字列を追加するだけで良いです。また、上記の例ではジョークも取り入れています。