Hi, I'm developing a hybrid app and when no connection is detected, it redirect users to a view that should handle offline state.
This is the code, what I'm doing wrong here? because I can't navigate after check the connection with sucess..no error is trhown..just nothing happens..
CODE:
<div data-role="view" id="vOffline" style="width: 100%; height: 100%" class="blackbg" data-before-show="connectionLoop"></div>
<script>
function connectionLoop() {
if (navigator.connection.type != Connection.NONE) {
kendo.mobile.application.navigate("#home");
//also does not work using #:back..actually sometimes works and sometimes don't..I can't figure it out why..
return;
} else {
setTimeout(function () {
navigator.notification.alert("It seems that is no connection available. \nLets try again?", connectionLoop, username, "YEP!");
}, 500)
}
}
</script>