views:

45

answers:

1
$.post('scripts/spedisci_mail_controllo.php', function(mail_spedita){

    /*this prints void alert*/
    alert(mail_spedita);
    /*this prints void alert*/

    if (mail_spedita=="1"){

        $('#message').load('pagine/message_mail_controllo_spedita.html', function(){
            mostra_messaggi();
        });

    }
    else {
        $('#message').load('pagine/message_errore_server.html', function(){
            mostra_messaggi();
        });
    }

});  

this code is fired by clicking an anchor.it does not work.in my code there are at least 10 other POST requests that are working properly.
is this wrong in some way?
thank you

ADDITIONAL INFO:

PHP only echoes a string to debug, tried to alert(mail_spedita), browsers alerts nothing.
php file permissions are 777

working post request

$.post('scripts/controlla_login.php', function(stato_login){

                if (stato_login=="1"){

                    $('#profilo').load('pagine/profilo.html', function(){

                        $.post('scripts/leggi_utente.php', function(xml_utente){compila_profilo(xml_utente);});

                    });

                }
                else{
                    $('#message').load('pagine/message_per_favore_loggati.html', mostra_messaggi());
                }


        });
A: 
<a href="" onclick="my_function">click here</a>  

this was not working.added "#" into href and now it works correctly

palominoz