Hi, I'm trying to return value from onSuccess I saw somes posts but it
doesn't help me.
this is my code:
function nick(nano){
var respuesta = "";
var parametros="nickk="+encodeURIComponent(nano);
new Ajax.Request('chat.php',{
method: 'GET',
parameters: parametros,
onSuccess: function(resp){
respuesta = resp.responseText;
}
});
return respuesta;
}
and I call the function here:
function cpvm(){
var antiguo=$("privadosant").innerHTML;
var parametros="cpvm=si";
new Ajax.Request('chat.php',{
method: 'GET',
parameters: parametros,
onSuccess: function(resp){
antiguo.innerHTML=resp.responseText.split("|")[0];
i=1;
while (i<=resp.responseText.split("|")[0])
{
var salasdiv=$("salas");
if(salasdiv.innerHTML.match(resp.responseText.split("|")[i])==null)
{
var newdiv = document.createElement('div');
var divid = resp.responseText.split("|")[i];
newdiv.setAttribute('id',divid);
newdiv.innerHTML =
nick(resp.responseText.split("|")[i]);
salasdiv.appendChild(newdiv);
}
i++;
}
}
});
}
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.