如果有互联网连接,则检测到JQuery Mobile [英] JQuery Mobile Detected if there's internet Connection
本文介绍了如果有互联网连接,则检测到JQuery Mobile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
推荐答案
有什么方法可以检测我的手机上是否有互联网连接?没有必要的代码 - 它是HTML5 API的一部分。检查 window.navigator.onLine
的值 - 如果用户离线,它将是 false
。
There's no code necessary for this -- it's part of the HTML5 API. Check the value of window.navigator.onLine
-- it will be false
if the user is offline.
http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#browser-state
这篇关于如果有互联网连接,则检测到JQuery Mobile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文