checking if internet connectivity exist or not banner
checking if internet connectivity exist or not banner

While checking if my internet connectivity of have been lost there are so many answers regarding this on the internet  such as on stackoverflow , kirupa but on subinb sucks since they cannot be able to provide a valid crew to solution regarding this question on the internet.

Until I came by the answer right in my email Titled How to Check Internet Connection Exists or Not using Javascript? from w3lessons i have rest of mind

So i checked in and found this below with explanation

This findings is simple and comprehensive step by step

Note: view  this  picture below here if you are having problem following the steps.

 View Demo

download the javascript files for checking internet connectivity lost or recovered

1. simply add the below code right after this tag </head>

explanation: these are two stylesheet (css) responsible for styling the disconnectivity status panel

[snippet slug=1st-and-2nd-css-to-style-the-plugin lang=html]

2. Then add the following  below javascript code snippet immediately before the tag </body>

explanation : this pings the image named tiny-image.gif on website host server directory

[snippet slug=checking-if-internet-connectivity-exist-or-not-javascript lang=javascript]

3. Finally put this path of the below javascript immediately after same tag </body>

explanation: here is the offline.js plugin that performs the whole functions.

[snippet slug=checking-if-internet-connectivity-exist-or-not-js lang=javascript]


checking if internet connectivity exist or is lost – Shopinson from u/shopinson

LEAVE A REPLY

Please enter your comment!
Please enter your name here