What is the best way to check internet connection

Posted Jan 01, 1970 12:00 AM

I made a CMS which during operation pulls large amounts of data. CMS is made in PHP, MySQL, jQuery, Bootstrap and use AJAX.

The problem is if you lose your internet connection can cause problems on displaying and scrolling.

I would love if there is a good way to show the error and blocks all functions on the site when there is no internet connection. When the connection is established it should be all function allowed on the site.


(Sorry for my bad English.)

Tagged php jquery mysql

Similar Topic Questions

C# checking Internet connection

Can you please tell me if there is a way to check if there is a internet connection in my computer when my C# program is running. For a simple example, if internet is working, I would output a...

Posted Nov 30, 2013 11:49 AM

Checking internet connection with JavaScript

Is there a way to check internet connection using pure JavaScript, without requesting something from the web? I've tried to use alert(navigator.onLine); but it always returns true. Thanks!...

Posted Jan 27, 2014 9:21 AM

Checking internet connection using HttpWebRequest

I'm developing an application that needs to call a rest API. The application needs to check if there is an internet connection before performing a HttpWebRequest At the moment I'm using the below code to check is internet is available: var request...

Posted May 08, 2014 7:50 AM

C# CSOM check internet connection

I developed a console application using Microsoft.SharePoint.Client library. Basically what it does is check if a folder exists in a list (creates if not), creates a list item and attaches files to that list. All seems to work fine, but...

Posted Jul 11, 2014 6:46 AM

How to check internet connection and display a default image

I am developing an app using phonegap.I want to display a default image in case there is no internet connection in the mobile.In this way if the user is not connected to the internet the user instead of seeing...

Posted Jul 20, 2014 12:36 PM

Check internet Connection on phone

I wanted to check whether my phone can connect to Internet or not. I have seen several questions already. One of those is Question . It says to use NetworkInterface.GetIsNetworkAvailable() this and i tried it. I have disconnected my PC...

Posted Aug 04, 2014 11:04 AM

Checking internet connection using Task

I am trying to execute a background Task that checks the internet connection without blocking the GUI (checking fonction requires 3s to check the connection). If successful (or not) a panel display an image (red or green according to the...

Posted Aug 18, 2014 12:55 PM

UnhandledException during checking internet connection

I want to check internet connection in App.xaml.cs file but when I'm doing it in constructor it throws UnhandledException, why? Is it possible to do this? When I check it in for example MainPage.xaml.cs it works. My code: if (NetworkInterface.GetIsNetworkAvailable()) { ...

Posted Aug 19, 2014 10:42 AM

Windows 8 app check internet connection c#/xaml

I have a custom user control that displays visually if my user is connected to the internet in the app bar. The problem is that if the user isn't connected a have the four connection bars visually turn red to...

Posted Sep 03, 2014 4:47 AM

Java checking internet connection on Linux issue

I need to check internet connection, so I write this small class: import java.net.HttpURLConnection; import java.net.URL; import java.util.Timer; import java.util.TimerTask; public class TestConnection { public boolean isInternetAccessed() { try { ...

Posted Oct 14, 2014 4:12 AM

How check Internet-connection in Android? [duplicate]

This question already has an answer here: How do you check the internet connection in android? ...

Posted Dec 23, 2014 12:34 PM

How to check internet connection using java

I have a small project which needs internet connection. Unfortunately my internet is occasionally down. Then it throws away exception: "java.net.SocketException: Network is unreachable" ... My idea was to check internet connection before I do any operation and if it's down, just...

Posted Feb 04, 2015 7:33 AM

Check internet connection available or not in c#

I am using below method to check internet connection available or not in c# and I was using it from What is the best way to check for Internet connectivity using .NET? public static bool CheckForInternetConnection() { ...

Posted Feb 16, 2015 9:10 AM

Checking internet connection with Python

I'm working on an application that uses internet so I need to check if there is an internet connection at the load of the application so I use this function: def is_connected(): try: ...

Posted Feb 26, 2015 8:31 AM

Checking internet connection in javascript quite slow

I have testing asp.net site running on local IIS. i am using google map API's in my application. To load this API i m first checking internet connection like this function checkNetConnection() { var xhr = new XMLHttpRequest(); var file = "https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=1|DA5859|FFFFFF"; var r...

Posted Mar 04, 2015 10:06 AM

Check Internet connection in Javascript fail in IE9 or below

I have been using below code to find if pc is connected to internet or not function checkNetConnection() { var isIE8 = window.XDomainRequest ? true : false; var xhr; if (isIE8) { xhr = new window.XDomainRequest(); } else { xhr...

Posted Mar 24, 2015 5:15 AM

WinRT How to check internet connection?

I use this function to check internet connection public static bool IsConnectedToInternet() { ConnectionProfile connectionProfile = NetworkInformation.GetInternetConnectionProfile(); return (connectionProfile != null && connectionProfile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess); } and it works fine if i am not connected to a network, but the problem appear...

Posted Apr 03, 2015 5:34 AM

Python: checking internet connection (more than once)

I have implemented a quick solution to check for internet connection in one python program, using what I found on SO : def check_internet(self): try: response=urllib2.urlopen('http://www.google.com',timeout=2) ...

Posted Jul 03, 2013 5:29 AM

Check internet connection with offline.js

I am creating phonegap application for android. I want to check internet connection for application. I am using offline.js. But it's not working at all for me. My code is, <script> $(function () { function on(evt) { ...

Posted May 11, 2015 4:19 AM








Forgot Password
Reset my password!