If you want to check the network information in your code, here is the plugin that cordova provides to check if the user is online or offline. This plugin gives the information of cellular or wifi connection of the device and it can also check if the device has an internet connection or not.
Here is the process how you can implement this plugin into your code:
Installing the plugin:
To install this plugin, you have to run the following command:
Platforms that are supported for this plugin includes:
Amazon Fire OS
Windows Phone 7 and 8
How to check connection:
There is an object called connection that can provide information about the cellular or wifi connection of device. It can be exposed via navigator.connection method. It has property connection.type that is used to determine the connection state.