jquery-websocket
jquery-websocket copied to clipboard
Detecting when WebSockets is not supported in the client
Hi there! Just started using this plugin. One thing I was having trouble with was detecting if websockets is not supported on the client to be able to fall back to long polling.
Checking the source code it seems that the ws variable will contain an object even in the case websockets is not supported: { send: function(m){ return false; }, close: function(){} }.
Should it be better to just return false instead so we can check for ws === false to be able to take the necessary steps for the fallback?
Maybe I'm missing something, how are you detecting today if websockets are not supported in the client with this plugin?