Skip to content

Commit

Permalink
edited readme to show example
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosky committed Oct 30, 2013
1 parent 879c4c8 commit 8a25b49
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -117,6 +117,23 @@ $(document).ready(function(){
Always use the WebSocket (ws:) form for your bullet URLs and Bullet
will change the URL as needed for non-WebSocket transports.

The URL can also be dynamic

``` js
var ctr=0;
$(document).ready(function(){
var bullet = $.bullet(function(){
var url = 'ws://localhost/path/to/bullet/handler'
+'?time='+Date.now()
+ '&ctr='+ctr;
return url;
});
bullet.onmessage = function(e){
lastCount ++;
};
});
```

The `$.bullet` function takes an optional second 'options' object.
The following properties are supported:

Expand Down

0 comments on commit 8a25b49

Please sign in to comment.