js判断网络状态

tech2025-08-14  8

window.navigator.onLine  的值为true是连接,否则为断开网络。

if (window.navigator.onLine == true) { //网络链接正常 } else { //网络连接失败 };

 

最新回复(0)