Use the addEventListener() method to attach a "online" and "offline" event to the window object.
NOTE: There will only be an "output" from this example when the browser shifts from offline to online.