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,

image

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

Advertisements

2 thoughts on “Detect Internet connection in HTML5

  1. Unfortunately this works only in WebKit-Browser (Safari, Chrome) but not in Firefox or probably in IE.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s