This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
The Connection.onchange
property represent an event listener for change
events. These events occur when the connection information change.
Syntax
connection.onchange = funcRef;
Where funcRef
is a function to be called when the change
event occurs.
Specifications
Specification | Status | Comment |
---|---|---|
Network Information API The definition of 'connection.onchange' in that specification. |
Editor's Draft | Initial specification |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | Not supported | 12.0 moz | Not supported | Not supported | Not supported |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | Not supported | 12.0 moz | Not supported | Not supported | Not supported |
Gecko notes
- The Network API can be disabled using the
dom.network.enabled
preference. - As of Gecko 12.0, the Network API is implemented for Android systems only. Support for Linux (bug 712442) and Windows (bug 721306) systems is in progress.
- Before Gecko 14.0,
navigator.mozConnection
was not an instance ofEventTarget
, meaning that you couldn't useaddEventListener()
could be called. This has been fixed.