tesses.http/Tesses.Http.KitchenSink/WebSite/counter/index.html

21 lines
531 B
HTML

<!DOCTYPE html>
<html lang="en">
<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>Counter</title>
</head>
<body>
<h1>Counter</h1>
<h3 id="txt"></h3>
<script>
const txt=document.getElementById('txt');
var source = new EventSource("/counter/count");
source.onmessage = function(event) {
txt.innerText = event.data;
};
</script>
</body>
</html>