+ 1
WiFi stuff
Hello, I want to write something that will check if I am connected to the internet, but I don’t really know what I’m doing... I found this method method online somewhere: if(navigator.online == true) { console.log(true)} else {console.log(false);} I’m not sure if this is working or not(or even working in the way I had intended), but I was curious as to how someone else would do it.
2 Respuestas
+ 3
Making a xhr request and check its response status.
It's onLine btw.
This is old but there's online and offline event listeners.
window.ononline = function();
0
Awesome thx