This API is available on Firefox OS for internal applications 仅。
getNetworks
method is used to search for available networks.
var request = navigator.mozMobileConnection.getNetworks();
A
DOMRequest
object to handle the success or failure of the method call.
If the request is successful, the request's
result
是数组化的
MozMobileNetworkInfo
对象。
Otherwise, the request's
error
is one of:
RadioNotAvailable
RequestNotSupported
GenericFailure
var request = navigator.mozMobileConnection.getNetworks();
request.onsuccess = function () {
this.result.forEach(function (networkInfo) {
console.log(networkInfo.longName + ': ' + networkInfo.state);
});
}
request.onerror = function () {
console.log('operation failed: ' + this.error.name);
}
Not part of any specification.
Archive
CFStateChangeEvent
DataErrorEvent
IccCardLockError
IccCardLockErrorEvent
MozCellBroadcastEvent
MozEmergencyCbModeEvent
MozIccManager
MozMobileCFInfo
MozMobileCellInfo
MozMobileConnection
MozMobileConnectionInfo
MozMobileICCInfo
MozMobileNetworkInfo
MozOtaStatusEvent
MozStkCommandEvent
USSDReceivedEvent