Detect Internet connection in HTML5

By Dhananjay Kumar Jun 20, 2012
In this blog I am going to explain about how to detect whether browser is connected to Internet or not.

In this quick post we will detect whether browser is connected to Internet or not? There are two ways you can detect it

  1. By making a AJAX call and setting the TimeOut property
  2. Using HTML5

In HTML5 you can detect it as following

1.png

This is supported in all modern browsers. In this way you can detect whether browser is connected to Internet or not. 

Dhananjay Kumar

Dhananjay kumar is an independent trainer, a consultant and a programmer from India. He has mentored more than 1000 professionals and known for his unique way of teaching. He has been part of the multiple projects for bi... Read more

Personal Blog: http://debugmode.net/
COMMENT USING