通过javascript检查连接 [英] check connection via javascript
本文介绍了通过javascript检查连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不会使用javascript
i wont to check connection available using javascript
推荐答案
检查连接是否可用,就像您在谈论Internet连接一样.如果是这样:
您可以通过发出失败的XHR请求来确定连接丢失.
标准方法是重试几次请求.如果未通过,请警告用户检查连接,然后正常失败.
对于XMLHttpRequest,请阅读此处: XMLHttpRequest对象 [
Looks like you are talking of Internet Connection. If so:
You can determine that the connection is lost by making failed XHR requests.
The standard approach is to retry the request a few times. If it doesn''t go through, alert the user to check the connection, and fail gracefully.
For XMLHttpRequest, read here:XMLHttpRequest Object[^]
使用此链接可能对您有帮助
问候
koolprasad2003:)
Use This link may be helpful to you
regards
koolprasad2003 :)
这篇关于通过javascript检查连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文