This version is old school.
Please find jQuery plugins on npm.
jQuery ConnectionStatus Plugin
A connection status plugin for jQuery. The plugin allows you to use a default DIV or a DIV you define to display a connection availability notice to the client. In addition, you can disable inputs such as buttons and text.