SSE

[edsanimate_start entry_animation_type= “flipInX” entry_delay= “1” entry_duration= “1” entry_timing= “ease-in” exit_animation_type= “” exit_delay= “” exit_duration= “” exit_timing= “” animation_repeat= “1” keep= “yes” animate_on= “load” scroll_offset= “” custom_css_class= “”]

The SSE (server-sent events) describes how the web page receives the automatic updates from a server.

The SSE is used for the client to update messages instantly through EventSource method.

The event handlers that are supporting EventSource are

Value Description
onopen server connection is open
onmessage message received
onerror error message

Sample code

<!DOCTYPE HTML>

<html>

<body>

<p>Click here <button id=”result”></button></p>

<script>

var source = new EventSource(“demo.asp”);

source.onmessage = function (event)

{

document.getElementById(“result”).textcontent += event.data;

};

<script>

</body>

</html>

Choose close() method to cancel an event stream.

[edsanimate_end]