thank you for your response dormilich.
heres my javascript now using
XMLHttpRequest or
AJAX HEAD Request,
-
function connectToServer()
-
{
-
var http = new XMLHttpRequest();
-
var url = "http://192.168.1.154/gcc";//the right servers IP.
-
http.open('HEAD', url);
-
http.onreadystatechange = function()
-
{
-
if (this.readyState == this.DONE)
-
{
-
//alert(this.responseText + " - "+ this.status);
-
if(this.status == 0 || this.status == 200)
-
{
-
alert("Url Exist.");
-
document.location.href = url;
-
}
-
else
-
{
-
alert("Url Not Exist.");
-
}
-
}
-
};
-
http.send();
-
}
-
-
window.onload = connectToServer;
-
-
even if i put the valid and invalid ip address for the server the result for
this.status is always
0, so it will redirect to that ip with /gcc like this
"http://192.168.1.155/gcc" - invalid,
"http://192.168.1.154/gcc" - valid, how can i get the right output or the call back after visiting the url if the
/gcc exist on that
IP?
I tried this in IE and the result is ok no problem in this browser, but on other browsers like chrome, mozilla, opera, and safari its not working to this browser. how can i fixed this?
thank you. :)