84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
How does js determine whether the user's network is useful? That is, I want to determine whether the user can use the external network? And make sure he has access to the Internet? God, please help me. . .
闭关修行中......
Request an external network address in the background and see if it can be returned normally.
$.ajax({ url: '/', success: res => alert('应该有网'), error: () => alert('应该没网') });
Want to try it?
You can use it directly, or learn fromhttps://www.npmjs.com/package/ping
https://www.npmjs.com/package/ping
Request an external network address in the background and see if it can be returned normally.
Want to try it?
You can use it directly, or learn from
https://www.npmjs.com/package/ping