It checks you are connected to the internet or not and warning the user via toast.
Demo
Works Automatically
Detection works automatically. The page does not need to be refreshed. When your internet connection is
lost or reconnected, you will be notified by toast at the top of the page.