The online/offline events are made to fire on state change only. If you need to check the connectivity at a certain point, you can use navigator.network.connection.type.
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
document.addEventListener("offline", this.onOffline, false);
document.addEventListener("online", this.onOnline, false);
if((navigator.network.connection.type).toUpperCase() == "NONE" &&
(navigator.network.connection.type).toUpperCase() == "UNKNOWN") {
this.onOffline();
}
else {
this.onOnline();
}
},
Hope this helps you.