Skip to content

Commit

Permalink
sse close connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Adminbck committed Jun 23, 2024
1 parent a75ccc6 commit 2fe4482
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ <h1>Server-Sent Events</h1>
eventSource.onmessage = function(event) {
const dataElement = document.getElementById('sse-data');
dataElement.innerHTML = event.data + '<br>';
};
eventSource.onerror = function(event) {
dataElement.innerHTML = 'Finished.. <br>';
};
</script>

Expand Down

0 comments on commit 2fe4482

Please sign in to comment.