I am using HTML5 Server-Sent Events as follows:
SSEUpdate = new EventSource("http://example.com/update.php"); SSEUpdate.onmessage = function(e){ console.log(e.data); }
It does not work in IE11. (Error in console: 'EventSource' is undefined
) Is there an identical Microsoft equivalent, or do I have to do something completely different?
A server-sent event is when a web page automatically gets updates from a server. This was also possible before, but the web page would have to ask if any updates were available. With server-sent events, the updates come automatically.
Obviously, the major difference between WebSockets and Server-Sent Events is that WebSockets are bidirectional (allowing communication between the client and the server) while SSEs are mono-directional (only allowing the client to receive data from the server).
BROWSER SUPPORT FOR Server Sent EventsChrome browser version 4 to 5 does not support Server Sent Events property.
What are Server-Sent Events? SSE definition states that it is an http standard that allows a web application to handle a unidirectional event stream and receive updates whenever the server emits data. In simple terms, it is a mechanism for unidirectional event streaming.
In a word, no.
Microsoft has not included SSE or an equivalent of SSE in any version of IE. IMO, you have two good options:
if ("EventSource" in global) return;
, it'll only run in browsers that do not support EventSource
.ws://
protocol), it works in IE10 and 11 and provides more options such as bi-directional communication.SSE native support for IE is not there. You can achieve same thing using polyfill
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With