I need to check the connection availability but,
window.navigator.online
not working in all browsers and its all version开发者_开发技巧s. 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.
You can't rely on that property.
You could request an image, and if it errors, assume the user is offline.
Using ajax call to test connectivity is the generic solution.
精彩评论