Salve, forse la domanda sarà stupida...ma facendo una richiesta Ajax con mootools, al click su un bottone la richiesta viene effettuata, ma dopo aver ricevuto il "response", se riclicco sul bottone, la richiesta non viene sollevata...
JAVASCRIPT
codice:
function On_response(resp){
$$("div").set({
"html":resp,
"id":"richiesta",
"styles":{"color":"red", "background-color":"#eee"}
});
}
function On_request(){
$("cont").set("html","");
var el = new Element("img",{
"src":"ajax-loader.gif",
"styles": {"position":"absolute", "top":"100px", "left":"630px"}
}).inject($("cont"));
}
function initAll(){
window.addEvent("domready", function(){
$("bottone").addEvent("click", function(){ alert($("testo").value);
new Request({url:"req01.php",
metod:"post",
onRequest: function(){ On_request(); },
onComplete: function(response){On_response(response);},
}).send("testo="+$("testo").value);//alert(0); $("testo").value
});//"CLICK"
});//DOM-READY
}//INIT-ALL
HTML:
codice:
<body>
<input type="button" name="bottone" id="bottone" value="Click" />
<input type="text" name="testo" id="testo" value="ok" />
<div id="cont">CONTAINER</div>
</body>