判断当前的网络状态

使用

window.navigator.onLine

当返回false时说明当前无网络,返回true时说明当前网络正常

原文地址:https://www.cnblogs.com/kugeliu/p/9469459.html