navigator.onLine 检查网络状态的方法返回true or false
if(navigator.onLine){ console.log("链接到网络") return true }else{ console.log("当前网络无链接") return false }
posted on 2018-12-07 09:36 niuben 阅读(258) 评论(0) 收藏 举报
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3