Created
May 27, 2011 12:54
-
-
Save louisremi/995177 to your computer and use it in GitHub Desktop.
Server Sent Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var evtSrc = new EventSource("http://example.com/server.php"); | |
evtSrc.onmessage = function ( event ) { | |
event.data // do something with the data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It should be noted that EventSource requires URIs to be same-origin.