HTML5 Navigator
This Navigator API provides functionality to return the online status of the browser.
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
offline
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() {}
document.body.addEventListener("offline", function() { alert("offline")}, false);
} |
online
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() {}
document.body.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 Sun Dec 30 2012 18:15:41 GMT-0500 (EST)