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!
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!
Share Improve this question edited Jan 31, 2012 at 3:28 Phillip Senn asked Jan 31, 2012 at 3:22 Phillip SennPhillip Senn 47.6k91 gold badges260 silver badges378 bronze badges 2- 2 There is also github.com/Yaffle/EventSource and github.com/remy/polyfills/blob/master/EventSource.js, but I'm not sure what each does over native EventSource. – Phillip Senn Commented Jan 31, 2012 at 3:31
- upvoted for presumed cowbell reference – wvdz Commented Jun 17, 2015 at 23:06
1 Answer
Reset to default 15As 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.