I am writing a app that is using server side code mainly. But the errors are thrown no matter what ever with a correct connection. Please help.
function checkConnection() {
        var networkState = navigator.connection.type;
        var states = {};
        states[Connection.UNKNOWN]  = 'Unknown connection';
        states[Connection.ETHERNET] = 'Ethernet connection';
        states[Connection.WIFI]     = 'WiFi connection';
        states[Connection.CELL_2G]  = 'Cell 2G connection';
        states[Connection.CELL_3G]  = 'Cell 3G connection';
        states[Connection.CELL_4G]  = 'Cell 4G connection';
        states[Connection.CELL]     = 'Cell generic connection';
        states[Connection.NONE]     = 'No network connection';
        if (states[networkState]="Unknown connection")
        {
        alert('Get in a trusted Connection: ' + states[networkState]);
        }
        else if (states[networkState]="No network connection")
        {
        alert('Warning: ' + states[networkState]+': Please Get Connection and Reconnect');
        }
        else
        {
        var ref = window.open('http://70.61.212.124:8083', '_self', 'location=no');
        }
    }
 
     
    