deepmoteria
deepmoteria

Reputation: 2441

window.navigator.online not working in all browsers and its all versions. Need a generic solution

I need to check the connection availability but, window.navigator.online not working in all browsers and its all versions. Need a generic solution that works in all the browsers and its all versions. It is not working mostly in the Chrome and Safari and in latest version of the Chrome.

Upvotes: 0

Views: 1452

Answers (2)

deepmoteria
deepmoteria

Reputation: 2441

Using ajax call to test connectivity is the generic solution.

Upvotes: 1

alex
alex

Reputation: 490263

You can't rely on that property.

You could request an image, and if it errors, assume the user is offline.

Upvotes: 1

Related Questions