Check whether a website is online or offline

Check whether a website is online or offline

Hello again
I've commited a post before about how to make a Jquery ping script, Well I've got it working, but the problem seems to go further than that.
As a matter of fact, I have this script for rebooting / halting the server the script is running from:

//JavaScript Document
function testServer()
{
   
$.ajax({
              
            type: "POST",
            url: "../php/server.php",
            data: "Daisy=Daisy",
            timeout: 2000,
            success: function(msg){
                alert(" Server rebooted with success: " + msg );
                return;
               
            },
            error: function(){

                alert(" Server is offline: " + msg);
                       
            }
           
        });

}



function restartServer()
{
   
    var fSuccess  =  function(){
       
    alert('Server is being rebooted, wait.');

     //The problem is not the sintaxe here, i've tried 'testServer' and 'testserver()' also  
     setTimeout(testServer,2000);   
       
    }
   
    $.ajax({
   
        type:    "GET",
        url:     "../php/server.php",
        data:    "restart=true",
        timeout: "2000",
        success: fSuccess,
        error: function(msg){
       
            alert(" Server offline: " + msg);
   
        }
   
    });


}

//html document
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="../templates/restart.css" />
<script language="JavaScript" src="../templates/jquery.js"></script>
<script language="javascript" src="../templates/restart.js"></script>
</head>
<body>
<div id="tab">
    <a>Defini&ccedil;&otilde;es&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;<font color="#007cc3">Restart</font></a>
</div>

<div id="tabs" align="center">
    <ul>
        <li><a href="javascript:" onclick="restartServer();"><span>Restart</span></a></li>
    </ul>
</div>  

</body>

</html>

The php script only reboot the server.

The question is that when the server is rebooted, the script simply stops, and $.ajax doesn't give me any response neither on success or error. And the thing is that it's not just about accessing the script, even when I set a simple alert on the setTimeout of var fSuccess (e.g setTimeout('alert("Daisy"),2000)) it doesn't work. Is it about the setTimeout function on the success arg of $.ajax? anyone has any idea of how to help me out?

Thanks,

Regards,

Daisy.