Permalink
Browse files

Make the example a little more interesting

  • Loading branch information...
1 parent 45f95a4 commit 7c79806f264a10103821ea21acdcd076ecae0bf6 @aslakhellesoy aslakhellesoy committed Feb 14, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 README.md
View
@@ -13,7 +13,13 @@ This library implements the [EventSource](http://dev.w3.org/html5/eventsource/)
```javascript
var EventSource = require('eventsource');
-es = new EventSource('someurl');
+es = new EventSource('http://googlecodesamples.com/html5/sse/sse.php');
+es.onmessage = function(message) {
+ console.log(e.data);
+};
+es.onerror = function() {
+ console.log('ERROR!');
+};
```
See the [spec](http://dev.w3.org/html5/eventsource/) for API docs.

0 comments on commit 7c79806

Please sign in to comment.