views:

44

answers:

2

Is there an easy way to check whether or not the user has connection to your website?

See if they don't get a connection error.

+1  A: 

You can create a simple service or page on your website and you can send a XmlHttpRequest (XHR) to your site and make sure you receive a valid 200 response.

Wallace Breza
+1  A: 

You can make an AJAX request with a specified timeout that checks to see if you get back a valid response (code 200).

Vivin Paliath