There is no magic behind checking a web-browsers support for a specific HTML5 feature. If you want to check if a browser supports the latest HTML5 WebSocket API then you just have to take care if there is an object called „WebSocket“ available via the DOM:
<script> if('WebSocket' in window){ alert('Hurray! Your browser supports HTML5 WebSockets.') }else{ alert('Sorry, but you are out of date!'); } </script> |
Nevertheless, there are still people who want to include a fancy library for such an inspection. You can do the same with Modernizr:
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script> <script> if(Modernizr.websockets){ alert('Hurray! Your browser supports HTML5 WebSockets.') }else{ alert('Sorry, but you are out of date!'); } </script> |