Directions: disconnect the internet connection from your machine and watch the status switch from online to offline (and back again if you want to see the online event fire).

Note that this polyfill phones home so it will also fire the offline event if the server this script is hosted on, goes down (feature or bug? who knows!).

ONLINE