jquery magic for websocket