Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Android 2.1 上的 navigator.onLine 是否存在已知问题?我在飞行模式下有一个 Droid,但 navigator.onLine 似乎无论如何都返回了 true。(我使用 HTML 清单来缓存页面,它的行为在 Mobile Safari 和 Firefox 的离线模式下运行良好。)
是的,据我所知,navigator.onLine 在 Droid 2.1 上总是返回 true。我认为这个问题已经在 2.2 中与许多其他与离线相关的 API 一起得到解决,包括连接类型的新 navigator.connection 枚举、当前正在使用的连接的 navigator.connection.type 以及“ononline”和“onoffline” “事件。
可以在此处找到对此的简短描述