이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

The online event of the Window interface is fired when the browser has gained access to the network and the value of Navigator.onLine switches to true.

Note: This event shouldn't be used to determine the availability of a particular website. Network problems or firewalls might still prevent the website from being reached.
Bubbles No
Cancelable No
Interface Event
Event handler property ononline

Examples

// addEventListener version
window.addEventListener('online', (event) => {
    console.log("You are now connected to the network.");
});

// ononline version
window.ononline = (event) => {
  console.log("You are now connected to the network.");
};

Specifications

Specification Status
HTML Living Standard
The definition of 'online event' in that specification.
Living Standard

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
online eventChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

See also

문서 태그 및 공헌자

최종 변경자: alexsasharegan,