mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
22 lines
No EOL
371 B
HTML
22 lines
No EOL
371 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset=utf-8 />
|
|
<title>event source test</title>
|
|
</head>
|
|
<body>
|
|
<script src="../EventSource.js"></script>
|
|
<script>
|
|
var es = new EventSource('/sse/');
|
|
es.onmessage = function (event) {
|
|
console.log('msg: ' + event.data);
|
|
};
|
|
|
|
es.onopen = function () {
|
|
console.log('connected');
|
|
}
|
|
|
|
console.log(es);
|
|
</script>
|
|
</body>
|
|
</html> |