ononline Event
Definition and Usage
ononline Event occurs when the browser starts working online.
Tip:ononline Event with onoffline Event Conversely.
Tip:You can also use navigator.onLine Property to determine whether the browser is in online or offline mode.
Example
Execute JavaScript when the browser starts working online:
<body ononline="myFunction()">
Syntax
In HTML:
<element ononline="myScript">
In JavaScript:
object.ononline = function(){myScript};
In JavaScript, use the addEventListener() method:
object.addEventListener("online", myScript);
Note:Internet Explorer 8 or earlier versions do not support addEventListener() Method.
Technical Details
Bubbling: | Not Supported |
---|---|
Cancelable: | Not Supported |
Event Type: | Event |
Supported HTML Tags: | <body> |
DOM Version: | Level 3 Events |
Browser Support
The numbers in the table indicate the first browser version that fully supports the event.
Events | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
ononline | Not Supported. | Discontinued since IE11. 8.0 |
3.0 | Not Supported | Not Supported |