Detect browser Web Sockets support

HTML5 Web Sockets are awesome! I’ve been toying around with it for a bit today and noticed that not every browser supports native HTML5 Web Sockets yet. Google Chrome 5 has native support for web sockets, FireFox 3.6 does not. This poses a problem if you’re building something awesome that does require web sockets. ~ Luckily, it’s easy to detect web sockets support through JavaScript. All you really need to do is check if WebSocket is defined or not.