2016-10-19 2 views
0

Der Versuch, eine doppelte Umleitung auf phonegap zu erhalten, wenn keine Verbindung oder offline, aber der Bildschirm dunkel bleibtphonegap Doppel Umleitung Offline-Netzwerkverbindung

<!DOCTYPE html> 
<html>  
<head> 
<script type="text/javascript">  
    function onDeviceReady() {  
        InternetOK();  
    } 
    function InternetOK() {  
        var networkState = navigator.connection.type;  
        if (networkState == Connection.NONE){ 
      window.location = 'offline.html';  
     } else { 
      window.location = 'app.html'; 
     }  
    document.addEventListener("deviceready", onDeviceReady, false); 
</script>    
</head>  
<body>    
</body>  
</html> 

Antwort

0

Bitte fügen cordova.js nach <head> Tag

<script src="cordova.js"></script>