JavaScript

{dialog.object}._getOnlineStatus Method

Syntax

{dialog.Object}._getOnlineStatus()

Description

Returns true if the device has an internet connection. Returns false if there is no connection.

var flag = {dialog.Object}._getOnlineStatus();
The onConnectionChange client-side event fires when the connection state changes.

For testing how your component will behave when it is offline, you can simulate an offline condition and force the ._getOnlineStatus() method to return false even when you do have a connection by calling the {dialog.object}._setSimulatedOnlineStatus('off'); method.

(Android only) If you are building a PhoneGap application, be sure to include the 'Network Information' plugin in the 'Required PhoneGap Core Plugins' section in the PhoneGap Build Project Settings or else this method may always return true, regardless of the actual network status.

See Also