diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-04-09 21:28:08 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-04-09 21:28:08 +0200 |
commit | 8de02bbdddebb915dd029b1a6e329a7e2efe9b9e (patch) | |
tree | 81524942e4d5bfee29ffb36bb21b31fca12b7d38 /static/js | |
parent | 24a8c82305b81c11d26589dc82224640ab29fc35 (diff) |
Lafargue: Use web sockets to provide instantaneous updates.
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/lafargue.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/static/js/lafargue.js b/static/js/lafargue.js new file mode 100644 index 0000000..06e967d --- /dev/null +++ b/static/js/lafargue.js @@ -0,0 +1,8 @@ +jQuery(function($) { + if (WebSocket) { + var socket = new WebSocket('ws://localhost:3001/lafargue/events'); + socket.onmessage = function(event) { + $('.lafargue-list').prepend(event.data); + }; + } +}); |