Computer scienceProgramming languagesJavaScriptInteraction with backendWebsockets

Server-sent events

Events of SSE

Report a typo

Match the server-sent event methods with the corresponding snippet.

Match the items from left and right columns
eventSource.onopen =
eventSource.onmessage =
eventSource.onerror =
(e) => { console.log("Message", message.data); };
(e) => { console.log("The connection has been established."); };
(e) => { console.log("Error", e.data); };

Create a free account to access the full topic