Detecting if a site is online.
Hello everyone, I was wondering if it is possible to detect if a site is online using JavaScript. For example if google.com is online then alert("Online"); and if google.com is offline then alert("Offline");
I want to use this for two things, one is to detect if a particular URL is online and the other is to detect if the user has an internet connection by detecting if the user can access a site that very rarely goes offline.
Basically, I want to check if the user is able to access a website like google.com and if not alert("Offline"); and if so alert("Online");
Any help would be very much appreciated.
- Chris
P.S: I would not like to use XMLHttp for this.