Created
November 22, 2012 12:06
-
-
Save brianleroux/4130820 to your computer and use it in GitHub Desktop.
network connection api example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var states = {} | |
states[navigator.connection.UNKNOWN] = 'Unknown connection' | |
states[navigator.connection.ETHERNET] = 'Ethernet connection' | |
states[navigator.connection.WIFI] = 'WiFi connection' | |
states[navigator.connection.CELL_2G] = 'Cell 2G connection' | |
states[navigator.connection.CELL_3G] = 'Cell 3G connection' | |
states[navigator.connection.CELL_4G] = 'Cell 4G connection' | |
states[navigator.connection.NONE] = 'No network connection' | |
console.log(states[navigator.connection.type]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment