I am having problems with checking if a device has no internet connection. I am using cordova 5.0.0 CLI. This is my code:
if(navigator.onLine) {
alert(\"on
Add this to your index.html :
document.addEventListener("offline", function(){ navigator.notification.alert("No connection found") }, false);
It will alert you if there isn't a network connection.
If you don't have the notification plugin :
document.addEventListener("offline", function(){ alert("No connection found") }, false);