jquery - Checking internet connection using JavaScript -
itemprop = "text"> problem I want to show a warning that the Wi-Fi is off [I.e. no internet connection] In my webpage, I have lots of buttons, pop-ups, etc. Users can click on anything when offline. But I want to show that there is a failure in the API call or not. I can check navigator.online in each click. But I do not want to type the function calls or the number of lines, is this a normal way to use jQuery, JS, Ajax? "The alert should be shown when the call failed, which is caused by a user's action" such as $ Ajax with any error Should not be bound by the device / page. Hello, I have made the following efforts: Navigator.online // It works fine I used it as described below but it is not working . & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script & gt; & Lt; Script & gt; Window.jquire || Document.write ('& quot; script src = "js / vendor / jq...