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

21 lines
531 B
HTML
Raw Permalink Normal View History

2022-08-22 17:30:32 +00:00
<!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>