dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
721 B
23 lines
721 B
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>EventSource example</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<script src="../eventsource.js"></script>
|
|
<script>
|
|
var es = new EventSource("events.php");
|
|
var listener = function (event) {
|
|
var div = document.createElement("div");
|
|
var type = event.type;
|
|
div.appendChild(document.createTextNode(type + ": " + (type === "message" ? event.data : es.url)));
|
|
document.body.appendChild(div);
|
|
};
|
|
es.addEventListener("open", listener);
|
|
es.addEventListener("message", listener);
|
|
es.addEventListener("error", listener);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
</html>
|