I’m trying to write a script that will tell if my wife’s laptop is on my home network or not.
If it’s on home, it will branch to a page on my webserver at home, otherwise it will look for the intranet server at my wife’s office. I’d like a third option if she goes online in a hotel or such.
There doesn’t seem to be a way to read an IP or gateway address from Javascript, and I’ve been unable to find a method that will return URL availability, i.e. something along the lines of;
[CODE]if (isAvailable(http://homeserver/)) {
window.location = “http://homeserver/”;
} else if (isAvailable(http://work-intranet/)){
window.location = “http://work-intranet/”;
} else {
window.location = “file:///c|fallbackpage.htm”
}
I’d put this in a default page on the laptop, and have it carry her to the appropriate location.
I simply haven’t been able to find something that will return information about the environment or the availability of a given URL.
I’m sure I’m not the first one to try this. Does any one have any ideas?