In this tutorial, we'll take a look at the JavaScript Online Offline Events and how they can be used to detect whether the user has an active network connection.
JavaScript Online Offline Events
---------------------------------------------------
00:00 Introduction
00:34 The navigator object
01:28 Setting up events
02:39 Updating a UI
05:00 Connection speed
— Follow Me —
Twitter: / codebubb
Facebook: / juniordevelopercentral
Blog: https://www.juniordevelopercentral.com/
— Thanks! —
So we'll start off our JavaScript tutorial by looking at the Navigator object and see how you can use the onLine property to determine the user's current network status.
Then we'll move on to looking at the JavaScript Online Offline events and see how you can set up a couple of simple event listeners to detect when the user's network connection changes.
Once you understand how the two JavaScript Online Offline events work, we'll create a simple example that demonstrates how to update a bit of UI to display to the user the status of the current network connection.
Finally, we'll take a look at the connection property that's also available on the Navigator object and see how you can use this to gain further information about a user's network connection.
javascript offline tutorial
#javascript Channel Handle @codebubb