connection.update Event

This event is fired in response to the intel.xdk.device.updateConnection command to indicate that the device's Internet connection has changed

Description:

This event is fired in response to the intel.xdk.device.updateConnection command. The connection parameter on the event object will contain one of the following values:

Values Connection
wifi The device has an active wifi connection
cell The device has an active cellular data connection
none The device does not currently have a data connection

Example:


var previousConnectionState = "";
document.addEventListener("intel.xdk.device.connection.update",function(e){
        if (previousConnectionState != intel.xdk.device.connection)
        {
                previousConnectionState = intel.xdk.device.connection;
                debug(intel.xdk.device.connection);
        }
        setTimeout("intel.xdk.device.updateConnection();",2000);  //after we get an update on the connection, check again 2 seconds later
},false);
                  
For more complete information about compiler optimizations, see our Optimization Notice.