Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 352
Phillip Senn Avatar asked Jan 31 '12 03:01

Phillip Senn


1 Answers

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.

like image 100
karlcow Avatar answered Oct 19 '22 01:10

karlcow