This is a very simple WebSocket Client wrapper.
<script src="js/poorws.js"></script>
var ws = new poorws("SERVER URL");
ws.onStatusChange = function(status){
$("#status").text(status);
};
$("#sendmes").click(function(){
ws.send("testes");
});
ws.onMessage = function(mes){
var str = JSON.parse(mes.data);
console.log(str);
};
That's all! Enjoy! :D