Search code examples
javascriptjqueryserver-sent-events

Is there a jQuery EventSource?


Server Sent Events seem like a prime candidate for a jQuery plug-in. Page 921 of JavaScript, the Definitive Guide shows how to use EventSource. But then page 923 says that IE uses attachEvent instead of addEventListener.

I found jQuery.EventSource on github, but there's no mention of attachEvent. It instead falls back to using $.ajax.

Q: If I'm going to use the EventSource feature of JavaScript, should I use jQuery.EventSource?

I gotta have more jQuery!


Solution

  • As of today IE9 doesn't support EventSource (Server Sent Events). In the good article by Remy Sharp, there is at the end of the article a list of polyfill solutions.