diff website/src/examples/sse_pull.html @ 1738:9713f7fd50b3

server-sent events
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2022 19:23:53 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/website/src/examples/sse_pull.html	Thu Nov 03 19:23:53 2022 -0600
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+	<head>
+		<style>
+			body {
+				white-space: pre;
+			}
+		</style>
+		<script>
+			let eventSource = new EventSource(location.origin+'/examples/sse_push.html');
+			eventSource.onmessage = function(event) {
+				document.body.textContent = event.data;
+			};
+		</script>
+	</head>
+	<body>pull server-sent events</body>
+</html>