Latest web development tutorials

ononline event

Event Object Reference Event objects

Examples

Execute JavaScript in the browser to work online:

<Body ononline = "myFunction ()">

try it"


Definition and Usage

ononline event is triggered when the browser to work online.

Tip: ononline opposite event onoffline event.

Tip: You can also use navigator.onLine property to rub possible if the browser is online or offline mode.


Browser Support

Figures in the table represent the first browser to support this version of events.

event
ononline not support IE11 obsolete
8.0
3.0 not support not support


grammar

In HTML:

<Elementononline = "myScript"> try

In JavaScript:

object .ononline = function () {myScript }; try

JavaScript, use the addEventListener () method:

object .addEventListener ( "online", myScript ); try

Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.


technical details
Whether to support the bubble: No
It can be canceled: No
Event Type: Event
Supported HTML tags: <Body>


Event Object Reference Event objects