how to detect the mobile connection is 2G/3G/WIFI using javascript -


i have similar requirement in link below have handle using javascript. have detect whether mobile internet connection 2g/3g or wifi . based on connection have perform diffent operations.. note : mobile can b of os andriod/ ios/bb .. need handle mobile os.

is there way detect kind of connection i'm using ? wifi, 3g or ethernet?

request masters me inputs. :)

network information api (this experimental technology):

the network information api provides information system's connection, in term of general connection type (e.g., 'wifi', 'cellular', etc.). can used select high definition content or low definition content based on user's connection. entire api consists of addition of domxref("networkinformation") interface , single property navigator interface: navigator.connection.

var connection = navigator.connection || navigator.mozconnection || navigator.webkitconnection; var type = connection.type;  function updateconnectionstatus() {   alert("connection type change " + type + " " + connection.type); }  connection.addeventlistener('typechange', updateconnectionstatus); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -