Salve, vorrei sapere cosa sbaglio nel fare una richiesta ad una pagina .php con javascript usando il framework Mootools
La pagina "ajax.php" a cui invio la richiesta è semplicemente così:
Come risposta, ottengo "[object Text]"....dove sta l'errore?
Grazie in anticipo
Codice:
function control_form_eventi(){
if($("titoloEvento").value == ""){ alert("Il campo TITOLO deve essere compilato"); return false; }
var myRequest = new Request.HTML({
url:"ajax.php",
method:"post",
data:{"titoloEvento":$("titoloEvento").value },
onRequest: function(){
wait_event.inject("gestione_eventi");
wait_event.set("html", "Req sended!" );
},
onFailure: function(xhr){
alert(xhr);
},
onSuccess: function(resp){
wait_event.set("html", resp);
}
}).send();
}
La pagina "ajax.php" a cui invio la richiesta è semplicemente così:
PHP:
if(isset($_POST["titoloEvento"]) ){ echo $_POST["titoloEvento"]; }
Come risposta, ottengo "[object Text]"....dove sta l'errore?
Grazie in anticipo
