function checkConnection() {
var networkState = navigator.network.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.NONE] = 'No network connection';
alert('Connection type: ' + states[networkState]);
}
這裏我要顯示警報如果只有互聯網連接是不是可用的編緝?我使用如果statment if(statusValue == 'none'){ alert }
但這裏不是我的移動app.Here工作我使用的PhoneGap-1.3.0.js如果使用Phonegap沒有互聯網連接,如何顯示警報框?
我使用的Android 4.0版本... navigator.network.isReachable現在更高version.i工作試過 – Raj 2012-04-10 04:58:17