Javascript examples for DOM Event:onoffline
Execute a JavaScript when the browser starts to work offline:
<!DOCTYPE html> <html> <body ononline="onFunction()" onoffline="offFunction()"> <script> function onFunction() {//from w w w . jav a 2 s .c o m console.log("Your browser is working online."); } function offFunction() { console.log("Your browser is working offline."); } </script> </body> </html>