开发者

js check to see if user has connection

Is there an easy way to check whether or not the user has connection to your website?

See if they开发者_高级运维 don't get a connection error.


You can create a simple service or page on your website and you can send a XmlHttpRequest (XHR) to your site and make sure you receive a valid 200 response.


You can make an AJAX request with a specified timeout that checks to see if you get back a valid response (code 200).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜