From 8de02bbdddebb915dd029b1a6e329a7e2efe9b9e Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 9 Apr 2012 21:28:08 +0200 Subject: Lafargue: Use web sockets to provide instantaneous updates. --- static/js/lafargue.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 static/js/lafargue.js (limited to 'static') 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); + }; + } +}); -- cgit v1.2.3