This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11479|Reply: 0

[HTML/HTML5] Determine whether the browser supports Websocket

[Copy link]
Posted on 7/25/2019 9:34:38 AM | | | |
Web Sockets is currently not well supported in various browsers, only IE 10+, FF 34+, Chrome 31+, Safari 7.1+, and Android Browser 4.4+ are supported.



How is it tested?

The simplest way is to directly determine whether the global object contains a WebSocket object:




However, this approach has limitations.

In Android, even though the browser does not support WebSockets, this property still exists.

So the more rigorous way is:








Previous:79 lessons on construction management of Zhulong.com
Next:Asp.net MVC action method in the call to another controller's action method
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com