HTML5 Navigator

This Navigator API provides functionality to return the online status of the browser.


Supported Platform(s)

- BlackBerry OS 6.0+
- BlackBerry PlayBook 1.0+
- BlackBerry 10
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
onLine   Y Y Y Y YY
offline   Y Y Y Y YY
online   Y Y Y Y YY

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Events

void offline
void online

Properties

Boolean onLine

Events

offline

Warning

Only listeners added to window will be triggered. The event will not be triggered on document.


The offline event is triggered whenever browser switches to offline


Supported Platforms
 - BlackBerry OS 6.0+
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator


Parameters
CallbackFunction The callback function that will be invoked on the offline event
useCapture A boolean that indicates whether the user wishes to initiate capture

Code Example:
function onOffline() {}
  window.addEventListener("offline", function() { alert("offline")}, false);
}

online

Warning

Only listeners added to window will be triggered. The event will not be triggered on document.


The online event is triggered whenever browser switches to online


Supported Platforms
 - BlackBerry OS 6.0+
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator


Parameters
CallbackFunction The callback function that will be invoked on the online event
useCapture A boolean that indicates whether the user wishes to initiate capture

Code Example:
function onOnline() {}
  window.addEventListener("online", function() { alert("online")}, false);
}

Properties

static readonly Boolean onLine


The property returns a boolean value to indicate the status online or offline


Supported Platforms
 - BlackBerry OS 6.0+
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator


Code Example:
function supportNavigatorOnline() {
 if(window.navigator.onLine) {
   alert("onLine");
 } else {
   alert("offline");
 }
}
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:08 GMT-0500 (EST)