Salve a tutti devo realizzare semplice script che usi i timer ma non mi funziona.
Vi posto il codice che vale più di mille parole.

Codice PHP:
var timer null;

function 
checkWakeUp(){
    
    $.
ajax({
        
type "GET",
                
// file che se mi viene restituito posso dedurre che il server si è riacceso
        
url "checkWakeUp.php",  
        
success : function() {
            $(
'#overlayRiavvia').fadeOut('fast');
            $(
'#boxRiavvia').fadeOut('slow');
            
clearInterval(timer);
            return;
        }
    });
    
}

$(
"a[href='riavvia.php']").click(function(event) {

    
event.preventDefault();

    $.
ajax({
        
type "GET",
        
url "riavvia.php",  // File che spegne un server
        
success : function(){
            $(
'#overlayRiavvia').fadeIn('fast');
            $(
'#boxRiavvia').fadeIn('slow');
            
            
timer setInterval("checkWakeUp()"1000);
            return;
        }
    });
    
}); 
Non chiedetemi perchè devo spegnere il mio server
devo solo capire perchè quando la richiesta su checkWakeUp è avvenuta con successo i div che tiro fuori non vengono mandati giù e dunque capire che tutto è funzionato.